Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting wrong dates :s 1

Status
Not open for further replies.

N3XuS

Programmer
Mar 1, 2002
339
BE
I've been looking everywhere on the net, I don't see what I'm doing wrong.

My query is
Code:
SELECT link,datum,IP,type FROM visipro2 WHERE datum > #2007-03-08#  AND type  = 'email' order by datum desc

It doesn't only return the dates in march, but 3-oct. shows up as well.

link datum IP type
xxxxx.com 10/03/2007 xxxx email
xxxx.be 11/03/2007 xxxx email
xxxx.be 03/10/2007 xxxx email

I set the dates to text in de date datafield and it actually displays october.

What am I doing wrong :(
 
eh, how's about putting in a max date limit?

where date between #startDate# and #endDate#

also careful of the ## delimiters, they will default the date format to american, it might be easier to use datepart or dateserial to explicitly build up a date string and compare the strings.

--------------------
Procrastinate Now!
 
Didn't know about the #-american thing.
Anyhow, eventually did as you said and split it all up. Works fine now, thanks :)
 




hi,

Dates are Dates -- Strings are Strings.

"careful of the ## delimiters, they will default the date format to american" HUH?

A DATE VALUE returned from #string# assumes that the string within the delimiters has a certain (american) format.

The DATE VALUE that is returned by this CONVERSION is just a NUMBER, like 39156, which happens to be TODAY. The DATE VALUE has nothing to do with ANY format. The Format is associated with a CONVERSION to or from something that humans recognize as a date string.


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top