Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. select (dateadd(month,datediff(month,(0),getdate())-1,(0)));
  2.  
  3. select dateadd(month, -1, GETDATE());
  4.  
  5. SELECT DateAdd(month, -1, Convert(date, GetDate()));
  6.  
  7. SELECT Convert(datetime, DateAdd(month, -1, Convert(date, GetDate())));
  8.  
  9. select Cast(Cast(dateadd(month, -1, GETDATE()) as Date) as Datetime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement