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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i create DATE RANGE in formula? PLEASE HELP!! 1

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
crystal: 8.5
database: oracle 8.0

hi everyone,

i'm doing a monthly trend report, but i cannot the date range to work. the problem i'm having is that the data won't show once i have the date range if statement insides a formular.

formula:
if (cstr({DATE_APPLIED}) >= '1/1/2004' and
cstr({DATE_APPLIED}) <= '1/31/2004') then
{QUANTITY}


the outcome of the report:


jan04 feb04 mar04 ....... dec04(from 1-12 yr04)
qty val qty val qty val ........ qty val

300 $2300 200 $2300 350 $2300 .... 600 $2300

the above formula was placed under the qty of "jan04" section, however, the output taht i got is "0". when i delete the if statement inside the formula which only {QUANTITY} shown, it will show "300".

can all of the expert please HELP ME??? is it true that formula doesn't take date range???

please help.. this is urgent as well.. thank u thank u thank u

m
 
Don't convert a date to a string and expect < or > to work correctly.

Try:

if {DATE_APPLIED} >= cdate(2004,1,1) and
{DATE_APPLIED} <= cdate(2004,1,31) then
{QUANTITY}
else
0

Consider that your best approach to solving problems isn't to show how you think it sghould be done, it's to describe the environment and requirements:

Crystal version
Database/connectivity used
Example data
Expected output

Hopefully this will solve your problem though.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top