Print Page | Close Window

Problem with Data/time field

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12777
Printed Date: 30 March 2026 at 7:16am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Problem with Data/time field
Posted By: maniva
Subject: Problem with Data/time field
Date 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



Replies:
Posted By: dj air
Date 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.


Posted By: maniva
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net