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!

Inserting Date field in Header is blank. 1

Status
Not open for further replies.

tgraves8

MIS
Jul 13, 2004
26
US
I am working with a data base that has a date field that is a string instead of a date field.

I was able to create a new formula field called date with this info:

cdate(val(mid({CallLog.RecvdDate},1,4))
,val(mid({CallLog.RecvdDate},6,2))
,val(mid({CallLog.RecvdDate},9,2))) = {?Date}

Then a was able to create a new parameter field called Date,

I have allow range values set to true.

Before I added {?Date} I had a {?Begin Date} and a {?End Date} and I would have to type in the date. In the header it would say this report is run from {?Begin Date} to {?End Date}. Of course instead of the field names it would give the acutal dates that were given. Now that I have the Date field set as a date with a range. I drag the {?Date} to the header text box and when I run the report it is blank.

Not sure what I need to change so that I have the beginning and end range in the header.


-Tim

- Note: most of the information that got me this far I found on this site.
 
To show the date range use:

totext(minimum({?daterange}),"MM/dd/yyyy")+" to "+
totext(maximum({?daterange}),"MM/dd/yyyy")

In the record selection formula you should have:

{table.date} = {?daterange}

-LB
 
You'll need to use a formula to display a range.
@ShowRange
Code:
"Date range from "
& Minimum({?DateRange})
" to "
& Maximum({?DateRange})
This will show the dates in the default format.

You may want to change the date format, in which case you could use CStr, as follows
Code:
"Date range from "
& CStr(Minimum({?DateRange}), "MMM-dd-yyyy")
" to "
& CStr(Maximum({?DateRange}), "MMM-dd-yyyy")
Obviously, you'd change the formatting string to match your needs.

Alternately, you could just create 2 formulas that return the date values and place them on the report as you used to do with your discrete {?StartDate} and {?EndDate} parameters.
@Start
Minimum({?DateRange})

@End
Maximum({?DateRange})


Bob Suruncle
 
Thanks Guys,

Bob it worked great, this is what I added to the formula field. After that I put it in the header and it worked great.

"Recieved Between "
& CStr(Minimum({?Date})) &
" to "
& CStr(Maximum({?Date}))

-Tim
 
You have redundancy in your formula, change it to Bobs' first suggestion:

"Recieved Between "
& Minimum({?Date}) &
" to "
& Maximum({?Date})

Check out my FAQ for more advanced concepts:

faq767-5684

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top