Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Sql query date problem

Question posted by: fcccc (Newbie) on July 1st, 2008 10:54 PM
Hello guys, I need some help.
I have a table with a date field and i have a problem when i want choose data between two dates, like for example: 15-05-08 and 01-07-08.
When i choose this date it can't find the data, if I choose date between 15-05-08 and 16-07-08 the data is appear.
My conclusion is that if I choose the first digit lower date (15-) is more less that upper date, then the result is ok.
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
debasisdas's Avatar
debasisdas
Moderator
6,450 Posts
July 2nd, 2008
09:33 AM
#2

Re: Sql query date problem
Is the date stored as date or char ?

Reply
fcccc's Avatar
fcccc
Newbie
2 Posts
July 2nd, 2008
08:46 PM
#3

Re: Sql query date problem
Quote:
Originally Posted by debasisdas
Is the date stored as date or char ?


The type of data is char(26).(dd-mm-yy hh:mm:ss)

thank you for your answer

Reply
ck9663's Avatar
ck9663
Expert
1,258 Posts
July 3rd, 2008
12:47 AM
#4

Re: Sql query date problem
Convert both to the same data type. Preferrably datetime...


-- CK

Reply
Reply
Not the answer you were looking for? Post your question . . .
183,962 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft SQL Server Contributors