Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How do I get records between two dates?

Author  Topic 

m_killey
Starting Member

2 Posts

Posted - 2000-11-01 : 17:31:36
Now - before you reply and say "Ah that's easy..." - read on...

I have a table with a 'Value' field of type varchar(50). This field is used to hold any type of data (numeric, bit, text, etc) as well as dates in the format dd/mm/yyyy (British). What I would like to do is retrieve records with the 'Value' field between two dates

E.g. between '01/01/2000' and '20/02/2000'

The values are being interpreted as varchar, so the following WON'T work :

SELECT * FROM tProfile WHERE Value BETWEEN '01/01/2000' AND '20/02/2000'

as a record with value '28/01/2000' isn't retrieved...

How do I do the appropriate CONVERT to allow the between clause to operate properly ?

Mike.

   

- Advertisement -