[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Prior Month



Use date dateadd function in sql server. Sorry, I'm at home so can't get
you the syntax, but you can get it from "help" in query analyzer.  It is
something like dateadd(mm,-1, getdate())

-----Original Message-----
From: sqr-users-bounces+bmrazek=sympatico.ca@sqrug.org
[mailto:sqr-users-bounces+bmrazek=sympatico.ca@sqrug.org] On Behalf Of
Maria Ravanis
Sent: Friday, March 12, 2004 9:57 AM
To: This list is for discussion about the SQR database reporting
languagefrom Hyperion Solutions.
Subject: RE: [sqr-users] Prior Month

Unfortunately I am on SQL Server 2000

________________________________

From: sqr-users-bounces+maria_ravanis=skillsoft.com@sqrug.org on behalf
of George Jansen
Sent: Fri 3/12/2004 9:49 AM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] Prior Month



If you are using Oracle, Add_Months(Sysdate, -1) will work, for example

SQL> l
  1  SELECT Trunc(Add_Months(Sysdate, -1), 'Month')
  2* FROM dual
SQL> /

TRUNC(ADD_M
-----------
01-FEB-2004

SQL>


>>> Maria_Ravanis@skillsoft.com 03/12/04 09:26AM >>>
Does anyone have any code to identify the month prior based on the
system date?  I looked in the archives but couldn't get any of that
code
to work in my SQR.

Thanks - Maria

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users






_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users