sql >> Database >  >> RDS >> Sqlserver

SQL Server:datumbereiken berekenen

SELECT  'Anything' as Label
        ,DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) as firstdaythismonth
        ,DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) as today
        ,DATEADD(year, -1, DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0)) as firstdaythismonth_lastyear
        ,DATEADD(year, -1, DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)) as today_lastyear


  1. Vraag time-out van web-app, maar werkt prima vanuit beheerstudio

  2. Echo/return voegt witruimte toe voor variabele

  3. Hoe MySQL verbinden met Java?

  4. Bereken lopend totaal / lopend saldo