|
|
|
|
New Member
|
|
Oct 12, 2008, 09:16 PM
|
|
AddDate function not in report
I am attempting to add auser specified number of days to a date rage (Hearing Date) to calculate the end date of a prticular sentence. I use the control source property as :
=DateAdd("d",[Loss_of_Yard],[Hearing_Date])
I use the same parameters for each area I need to add the time to. It appears to function perfectly, but does not show the new date in the report I have created. The necessary information is in my query(I think) and the form sourc eis correct for all areas it just will not shoe up in my REPORT. Am I missing something with regards to the DateAdd function on a form? Should it go somewhere else?
PS.. Loss of date is user specified number 0-360 and is added to the date (Hearing Date). The number totals correctly but as stated, will not reflect in the report. What Am I missing. Any hel is appreciated.
|
|
|
Computer Expert and Renaissance Man
|
|
Oct 13, 2008, 05:54 AM
|
|
I've found that putting calcs in reports is often problematic. I try to put them in my queries whenever possible. In addition, I do not like using parameter prompt queries. Instead I prefer to use a form to enter criteria. So I would have an unbound form, with a text box for Loss of Yard, I would then have a column in my query like this:
EndSentence: DateAdd("d",Forms!formname!txtEOY,[Hearing_Date])
Where fomname is the name of the form and txtEOY, the name of the control.
Then bind a control on your report to EndSentence. Add a button on the form to kick off the report.
By the way, this also has the advantage of making use the user enters a number between 0 and 360. Using a parameter prompt there is no restriction on what number they can enter.
So you should have a column in your query like this:
|
|
|
New Member
|
|
Oct 13, 2008, 01:00 PM
|
|
Sorry I was not totally clear... I have a report with the control source set as =DateAdd("d",[Loss_of_Yard],[Hearing_Date])
The query has no criteria set and the query column for the sum of the variable days added and the "hearing Date" is named TimeTotal. I actually have multiple text boxes on my form that add user defined days to the date "Hearing date" All have a "=DateAdd" function as the control source. Should I not do this and make the query do the math? I have tried that but I can never get the query to give me a total on my form. If you need more info I will get it. Sorry I am sort of new at this... Thanks for your time.
|
|
|
Computer Expert and Renaissance Man
|
|
Oct 13, 2008, 05:53 PM
|
|
Again, I always put my calcs in the query wherever prossible. So yes, I think you should put it in the query then just bind a control to it.
|
|
|
New Member
|
|
Oct 20, 2008, 02:41 AM
|
|
got it thanks... put it in report... with control source as:
=DateAdd("d",[Loss_of_Yard],[Hearing_Date]). I could not get it to work in query.
|
|
|
Computer Expert and Renaissance Man
|
|
Oct 20, 2008, 06:43 AM
|
|
That's weird, but glad you got it working.
|
|
Question Tools |
Search this Question |
|
|
Add your answer here.
Check out some similar questions!
TV Out Function On
[ 0 Answers ]
I've got a DVD drive and the PowerDVD 5.0 player and every time I try to watch a newer DVD, I get the error message "TV out function error", I look at the details and it says I can't play copyright protected DVD's with the TVout function enabled. The weird thing is, ALL my graphics adapters just...
View more questions
Search
|