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

Need help with dates

Status
Not open for further replies.

Guest
I am using CR10 and ODBC [RDO] connection. However, I have a field in the report called e_date that is used to show the date selected for the report. This is not a parameter, but just a date field that is coming down from the data in the database. The initial problem that I had was getting the report to show dates that started on the weekends, such as Saturday May 1, 2004. And the formula that I used to correct the problem was,
dateserial(year({tablename.e_date}),month({tablename.e_date}),1) for the begining date and dateserial(year({tablename.e_date}),month({tablename.e_date})+1,1-1)
for the last date. However, this formula only works for selecting an entire month. I want to be able to display the date if the report is selected for only one day. For example, this is the way the report appears...

Report Totals for: Saturday, May 1, 2004 To Monday, May 31, 2004

This is when the report is selected to run for the entire month. But when the report is selected to run for just one day, it should appear as such...

Report Totals for: Monday, May 31, 2004 To Monday, May 31, 2004

How can I get the program to display only one day?
 
Why not use the parameter to display the date in that instance?

Try something like:

if minimum({?DateParm}) = maximum({?dateparm}) then
"Report Totals for "+totext(minimum({?DateParm}))
else
...use you regular code...

-k
 
Thanks for that formula, it worked great. However I am new to the programming field, fresh out of school in the real world of programming so please bear with me But,within this formula, I need the date format to be "Saturday, May 1, 2004" in which the program displays it as 5/1/04. I tried to go to format field and change the format there, but it thinks it is a string instead of a date field. How can I change the format within the formula? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top