Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of rafrancisco
rafrancisco

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
SOLUTION
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