Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Purchase Date Forumla 1

Status
Not open for further replies.

Yustrn

Instructor
Jun 19, 2002
42
US
Hello,

I'm using Crystal 8.5 and I'm having troubles with the following formula. Here is what I'm looking for.

I have a bunch of items purchase throughout the year but only want the items for two specific dates and a separate column on my report for each one. Something like

Customer A 11/28/03 3000 items
Customer B 11/28/03 4000 items

If {rot.xxx.purchasedate}=11/28/03 then {rot.xxxitemspurchased}else " "

but it keeps coming back telling me taht my formula is expecting a date??? UGH!
 
Hi,
To 'tell' Crystal that something( like a string ) is actually a date use:
Code:
If {rot.xxx.purchasedate}=Date('11/28/03') then {rot.xxxitemspurchased}else " "

The Crystal docs are a good resource.


[profile]
 
If your date field is actually a date datatype, then try:

If {rot.xxxpurchasedate}= Date(2003,11,28) then {rot.xxxitemspurchased} else ""

-LB
 
Also, Make sure you are using DATE function, not DATE-TIME. The default is DATE-TIME and this adds the 00,00,00 to the field.
If you try filtering your formula with only a DATE then it barfs because it is expecting the DATE-TIME format.

Check FILE|REPORT OPTIONS and the CONVERT TIME-DATE field in the box. It should be 'To Date' for your report.

Lastly, if this is common to ALL of your data sets in the DB you may want to set the GLOBAL option to be DATE only.

hth...Frog

------------------
Curious by Nature,
Linux by Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top