Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Reading the Date
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Reading the Date

 Post Reply Post Reply
Author
kpdillon View Drop Down
Groupie
Groupie


Joined: 29 December 2006
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote kpdillon Quote  Post ReplyReply Direct Link To This Post Topic: Reading the Date
    Posted: 11 April 2007 at 12:53am
Hi, I am working on a mod and for some reason I can't seem to get the Event_date to match the variable even though they "appear" to look identical.  Is there something specific I need to add to my query to get 4/10/2007 in the database to match 4/10/2007 in my variable?
 
strsql = "SELECT "& strDbTable & "Topic.Event_date LIKE '" & strDate & "%' FROM " & strDbTable & "Topic ")

WHERE (" & strDbTable & "Topic.Event_date = " & strDate &
 
Is there something specifal about the colum Event_date in WebWiz that is preventing me from doing an easy variable to database value comparison?


Edited by kpdillon - 11 April 2007 at 12:59am
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2007 at 4:56am
Could you use the Now() event to get the current date?

http://www.codefixer.com/tutorials/date_time_now_hour_functions.asp
Back to Top
MrMellie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 December 2006
Location: United Kingdom
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrMellie Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2007 at 9:20am
Have you converted strDate into international format? There's a function in one of the WWF files (functions_date_time_format.asp) to do this for you.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2007 at 9:53am
Depending on which database type you use depends on how the SQL needs to be formatted for dates, for example Access has # marks surrounding dates.
Back to Top
 Post Reply Post Reply

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.