|
| |
|
|
rikki
Posts: 382 Joined: 4/4/2004 Status: offline
|
DateAdd - asp code - 4/3/2008 13:13:19
Trying to expand this query to include querying the variable date to an existing date less a day.. Or another way to look at it may be the variable date plus one against and existing date.. The error I get is Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters. /campbookings1/1NEMO_copy(1)/4DateQuery_Nemo.asp, line 10 mySQL = "SELECT CampSite FROM NEMO1 WHERE ((#"&varDateStart&"# Between DateStart And DateEnd) OR (#"&varDateEnd&"# Between DateStart And DateEnd) OR (#"&varDateStart&"# = DateAdd(d,-1,DateStart)))"
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: DateAdd - asp code - 4/3/2008 13:46:47
quote:
DateAdd(d,-1,DateStart) Have you tried it this way? DateAdd('d',-1,DateStart) If that errors, try with double quotes. I can never remember when passing to Access. I assume you are using Access with the # date delimiters?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: DateAdd - asp code - 4/3/2008 13:53:04
After looking at this: mySQL = "SELECT CampSite FROM NEMO1 WHERE ((#"&varDateStart&"# Between DateStart And DateEnd) OR (#"&varDateEnd&"# Between DateStart And DateEnd) OR (#"&varDateStart&"# = DateAdd(d,-1,DateStart)))" is perhaps the logic a little sideways? Could you not do it like this instead? mySQL = "SELECT CampSite FROM NEMO1 WHERE ((DateAdd('d',-1,DateStart) BETWEEN #"&varDateStart&"# AND #"&varDateEnd&"#) OR (DateEnd BETWEEN #"&varDateStart&"# AND #"&varDateEnd&"#)" That *should* get all of those BETWEEN as well as the day before. That make any sense what I'm suggesting?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rikki
Posts: 382 Joined: 4/4/2004 Status: offline
|
RE: DateAdd - asp code - 4/3/2008 14:14:57
Hey - it works just like I want!! Thank you so much.. It is single quotes btw..
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|