zimmer9
asked on
Date format using CONVERT (Dashes format vs. Slashes format)
I get the following result by using the CONVERT function that follows:
(C.DateLost <= '2002/06/30' AND P.PropertyType='FIXED INCOME' AND LEN(P.IraCode) = 0)
Is there a way to change this date conversion to express the date as 2002-06-30 ? (hyphenated date vs. slashed date)
If @Prop = 'ALL'
BEGIN
SET @SQL = @SQL + ' AND (C.DateLost <= ''' + CONVERT(VARCHAR(10), @DateFI, 111) + ''' AND LEN(P.IraCode) = 0) '
END
(C.DateLost <= '2002/06/30' AND P.PropertyType='FIXED INCOME' AND LEN(P.IraCode) = 0)
Is there a way to change this date conversion to express the date as 2002-06-30 ? (hyphenated date vs. slashed date)
If @Prop = 'ALL'
BEGIN
SET @SQL = @SQL + ' AND (C.DateLost <= ''' + CONVERT(VARCHAR(10), @DateFI, 111) + ''' AND LEN(P.IraCode) = 0) '
END
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.