Need better current datetime syntax

后端 未结 1 1657
谎友^
谎友^ 2021-01-25 22:05

This is current/old Access query I inherited.Need to retrieve the past year Case log. How can I write a better current date in Where clause?

    Select (ID,DateL         


        
相关标签:
1条回答
  • 2021-01-25 22:25
    declare @date date
    set @date = DATEADD(YEAR, -1, GETDATE())
    
        Select (ID,DateLog,TimeLog)
            From tblActiveCase
            WHERE DateLog >= @date
    
    0 讨论(0)
提交回复
热议问题