Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP Date Select
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP Date Select

 Post Reply Post Reply Page  <12
Author
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2003 at 8:57pm
strSQL = "SELECT * FROM events WHERE [date] Between now() AND dateadd(""d"",7,now())"
No need to mix asp; access know the dateadd function as well

Edited by michael
Back to Top
phorne View Drop Down
Newbie
Newbie


Joined: 18 May 2003
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote phorne Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2003 at 9:10pm

Nope - that code did not work either and page would not display at all...

 

Do I need to go back and change the name of the date field to something other than date??

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2003 at 10:38pm
Not if you keep it in []'s The code I wrote work 100% as I am using it myself successfully. You are doing something else wrong, or you use an old version of access that might not know the function.
Back to Top
phorne View Drop Down
Newbie
Newbie


Joined: 18 May 2003
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote phorne Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2003 at 5:11am

Version of Access is 2000

All I am doing is taking the line of code that works:

strSQL = "SELECT events.* FROM events where date >= Date() order by date;"

and I cut and paste the code you guys have been sending me! (which I really appreciate!)

I am using an Iframe to load the page - but I don't think that is the problem as the code works fine with the line above....

You can see the page at: http://www.midgachristian.com/index1.asp

 

 

Back to Top
phorne View Drop Down
Newbie
Newbie


Joined: 18 May 2003
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote phorne Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2003 at 5:19am

Michael - I went back and put your code in again and get this error:

 Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/Events/display_select-test.asp, line 97

Thought it was because ther was no ";" at the end of the statement - added it in different places and then added an additional " - then the page would not display at all...

Sure it is something I am doing but I have been banging my head for days with this!!

Back to Top
phorne View Drop Down
Newbie
Newbie


Joined: 18 May 2003
Location: United States
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote phorne Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2003 at 5:49am

PROBLEM SOLVED!!!!!!!!

User on forum at http://www.haneng.com/

gave me the code:

strSQL = "select * from events where date >= Date() and (( Date <= #"&DateAdd("d",7,date)&"#)) order by date;"

This works great!!!!

Now I am wondering if I can change the number of days to add with a variable a user can select to view a different number of days??

Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.