Jump to content

using datetimenow()

Juan Vaca

Recommended Posts

But if current month is Jan, you might want this (Dec previous year)


case  when [closed date] IS NULL and Month(DateTimeNow())!=1 then Date(Year(DateTimeNow())-1,Month(DateTimeNow()) - 1,Day(DateTimeNow())) when [closed date] IS NULL and Month(DateTimeNow())>1 then Date(Year(DateTimeNow()),Month(DateTimeNow()) - 1,Day(DateTimeNow())) end

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...