Link to home
Start Free TrialLog in
Avatar of kelsanit
kelsanit

asked on

Crystal date formula needed to get Last year to last full month

Database field:  invoicedate  
Format: mm/dd/yyyy

Formula 1:
 Need formula to allow me to get last year to last full month.
For example if today is 4/13/2012 it need to put the following:

{oeeh.invoicedt} in Date (2011, 01, 01) to Date (2012, 03, 31)


Note: This formula will be used in a running total select area
Avatar of Mike McCracken
Mike McCracken

Try this

{oeeh.invoicedt} in Date (Year(CurrentDate)-1, 01, 01) to Date (Year(CurrentDate)-1, Month(CurrentDate),0)

or


{oeeh.invoicedt} in Date (Year(CurrentDate)-1, 01, 01) to DateSerial (Year(CurrentDate)-1, Month(CurrentDate),0)

mlmcc
Avatar of kelsanit

ASKER

so today is 4/19/2012 the second forumual you sent will pull

1/1/2011 - 3/31/2011


The last part of the formula appears to be using the current month and not the last full month
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the formula is pulling everything through 2012 instead of just 2011

example:
it is pulling 1/1/2011 - 3/30/2012 instead of 1/1/2011-3/30/2011
i think I have it working now. Thank you for you help. Do you know of a good cheat sheet I could get for all of these diffrent date formulas and functions?
The example you gave was... ..

{oeeh.invoicedt} in Date (2011, 01, 01) to Date (2012, 03, 31)

The replies just generalised that example to allow for changing years and months.