APD Toronto
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.
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.