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

Can't Sum a calculated date field in a chart?

Status
Not open for further replies.

JSD

Technical User
Jan 18, 2002
189
US
Hello,

I am working with a query that has a calculated field that subtracts two date fields to get its value. I want the sum of this value in a chart with 'date' as a baseline. However, I am having trouble getting msaccess to do anything but count the records for the calculated field. I get an error message that says I can't Sum date, text, key values. The calculated field is the difference of two dates, but doesn't appear to be in the date format (it results in a number). Also, I changed the format of the calculated field in the query to 'General Number', and it still won't let me sum the value in the chart. Here is the expression in the calculate3d field:

act setup hrs cnc: IIf([workcenter]="CNC" And [insu]=-1 And [down]=0;([timeout]-[timein])*24;"")

Can I put the format (General Number) in this expression somewhere so msaccess will recognize it is a number result that can be summed? Any help is greatly appreciated as always.

Many thanks

Jeremy
 
I wouldn't expect to be able to sum a value that might return a zero length string (""). Can you change the "" to a zero?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top