Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
No value in Form Date field
Old 11-16-2007, 11:32 AM No value in Form Date field
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
What to do. I get messed up with dates all the time.

I have a form that adds a record to an access db.

There is a form date field that may or maynot have a value in it.

If the form field is empty (no date entered,) and no value is passed the sql statement crashes.

What can I do to make this work? Is there a way of using an if statement in the sql statement to exclude adding a date when none exists? Or, is there another method to keep this from crashing on me?

I hope this makes sense..

Thanks for any help..

Chip
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
 
Register now for full access!
Old 11-16-2007, 02:50 PM Re: No value in Form Date field
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,515
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You would need an SP or a UDF to use if ... then in an INSERT query neither of which Access is noted for

simplest way would be to set a default value using ASP or not concat the column name and the value into the command string before sending the query
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-16-2007, 04:43 PM Re: No value in Form Date field
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
"not concat the column name and the value into the command string before sending the query" I think this is the way to go.

Thanks Chris. As always, I appreciate your help.
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Reply     « Reply to No value in Form Date field
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.48452 seconds with 12 queries