Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem with Data/time field
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with Data/time field

 Post Reply Post Reply
Author
maniva View Drop Down
Groupie
Groupie
Avatar

Joined: 04 April 2002
Location: Italy
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote maniva Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Data/time field
    Posted: 01 December 2004 at 4:47am
I've a problem querying a database that contain a data/time field.
I've this string :
strNewsSQL = "SELECT tblMostre.* FROM tblmostre where tblmostre.End = #" & date() & "# order by tblmostre.End desc;"
 
But when I execute it the resuld is that the date seems that are not compared.
 
Normaly it should show all the record with END date > today but the result is that also record with date last month are showed.
 
Please help !
Ivano Mangiarotti
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2004 at 6:34am
try CDate(table.fieldname) > #" & Date() & "#

with the string you have, it has to mact down to the second. you need to say later than that date or use a string that checks the day, month and year etc.
Back to Top
maniva View Drop Down
Groupie
Groupie
Avatar

Joined: 04 April 2002
Location: Italy
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote maniva Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2004 at 7:12am
I tried but it doesn't work.
 
I've noticed that the date in the database is stored as dd/mm/yyy
if compare the database field with a constant date I can see that the comparison is working only if the date is mm/dd/yyyy.
 
So I deduct that I've to invert the comparison date.
HOw is possible that the database is storing the date as dd/mm/yyyy and then I've to compare with a date mm/dd/yyy ?
 
Confused
Ivano Mangiarotti
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.