This is for SI am trying to convert a DATETIME so it formats as “mm/dd/yy”
I need the “LastPaymnt_Date” to be greater than or equal to 31-which I’ve successfully set up below. Any help would be appreciated
This is what I have; it generates an “Incorrect syntax near CONVERT” error
SELECT D1_Name AS 'Debtor Name', FILENO, Balance, LPaymnt_Date AS 'Last Payment Date'
FROM MASTER
WHERE LPaymnt_Date>=GETDATE()-31
CONVERT(varchar(20), GETDATE, 101
AND(Forw_no>= 340 AND Forw_no <=348)
OR Forw_no =831
ORDER BY D1_Name
You have the
CONVERTin theWHEREclause. You want it in theSELECT:See here for more:
SQL Server Date Formats