navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

DateAdd - asp code

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> DateAdd - asp code
Page: [1]
 
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.

(in reply to rikki)
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.

(in reply to rdouglass)
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..



(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> DateAdd - asp code
Page: [1]
Jump to: 1





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