04-05-2016 05:16 PM
Yes, do a compute field and subtract the dates.
You can specify your date as '01Jan2016'd
It HAS to be specified in this manner.
This assumes that when you imported the data you created a SAS date variable, it has a numeric type and a date format.
04-05-2016 07:21 PM
As above you need to do a compute field
You can use the INTCK Function get the difference between days - i.e
The result in this example is 5
04-05-2016 07:53 PM
And you can definitely use intck in the query builder. I don't know why, I just feel more "professional" using it to calculate number of days between two dates. Makes no sense, I know!
04-06-2016 03:39 AM
Usage of INTCK will be robust if SAS (ever) changes the internal format of date values.
It is also easier to adjust if datetime values need to be compared, as only 'DAY' needs to be changed to 'DTDAY'.
04-14-2016 09:04 AM