The SAS Output Delivery System and reporting techniques

extract quarterly data

Reply
N/A
Posts: 0

extract quarterly data

would appreciate if anybody could give me logic to pull data for the last quarter from the database. right now to pull for 1 month I am using
sysdate(add_months('mmyyyy'-1) some thing on these lines.
N/A
Posts: 0

Re: extract quarterly data

Posted in reply to deleted_user
allow SAS to derive the start date for "last-quarter"

Something like [pre] %let qtr_start = %sysfunc( intnx( qtr, "&sysdate"d, 0 ), date9 );
...
where transaction_date GE "&qtr_start"d [/pre]
but that depends on using a suitable format for the quarter date.
With "implicit-pass-thru" the SAS engine will do any reformatting from DATE9 to the style for your dbms. If you are using 'explicit-pass-thru' you need to prepare the proper format

good luck

PeterC
Ask a Question
Discussion stats
  • 1 reply
  • 129 views
  • 0 likes
  • 1 in conversation