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

fromdate from the beginning of the year

Status
Not open for further replies.

gagani

Programmer
Nov 20, 2011
57
GB
for a given fromdate and todate, i want the starting from 1st of january of that year to {?todate}, so i wrote

if {table.date} in date(year({?FromDate}),1,1) to {?ToDate}
then {table2.IDS} else tonumber({@null})
its working for some report but not for giving the right results for others. could anyone help with it.
is there any other way to write in the case of starting from the year.
 
What are you doing with this formula? What is incorrect with the results? Are you inserting a summary on it? What kind of summary?

-LB
 
You could try replacing {FromDate} with a year parameter and doing a formula field
Code:
Year({table.date}) = {?Year}
and {table.date} <= {?ToDate}
Put this in the report next to unselected data and it should say True or False. You could then use it for selection just by including @WithinPeriod in the selection command, no need to add = "True" though this would work.

Like lbass, I see no sense in the rest. I'm surprised tonumber({@null}) even works: it would certainly be simpler to specify zero or spaces.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top