Link to home
Start Free TrialLog in
Avatar of APD Toronto
APD TorontoFlag for Canada

asked on

SQL varchar Date

Hi Experts,

I just inheritted a badly setup database, where paymDate is varchar(20), but its contents is formatted as m/d/yyyy

My question is, in this case, how can I SELECT all records between 6/1/2011  and 6/30/2011?

When i do the following, i also get June 2010 data.

Thank you.
/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [id]
      ,[invoiceNumber]
      ,[paymentDate]
  FROM [citysightcarts].[dbo].[Invoices]
  
  WHERE [paymentDate] >= '7/1/2011'
    AND [paymentDate] <= '7/31/2011'
    
 ORDER BY id

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial