Crystal Reports - working with Date type in Selection Formula

  • Thread starter Thread starter £ukasz W.
  • Start date Start date
£

£ukasz W.

Hello everybody !

How is it in Selection Formula to work with Date type, for example to deduct
7 days, week, month, year from CurrentDate.
I'm trying to use such a stetement (CurrentDate - Date (0000,00,07)) but it
gives me an error that the year should be between year 1 and 9999.
Anybody can help me ?

Regards

Lucas W.
 
Hi,

a) Date(y, m, d) is the 'constructor' for dates
b) You can substract two dates (as in your example), then you'll obtain the
difference between them in days
c) Use the function DateDiff() if you want to calculate the difference in
weeks, months, years...

Regards,

Octavio
 
....
c) Use the function DateDiff() if you want to calculate the difference in
weeks, months, years...

Could You write some example, how this function works(syntax)

For example:
I have table "Invoices" in my database, with column: "Date_of_invoice"
and how get (using DateDiff()) rows with "Date_of_invoice" between
2004-04-01
and 2004-05-01


Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top