calculated field in query

C

cporter

I have a query that selects workorders from a table then trys to
calculate the total hours down by using the function:
DateDiff([h],[DAYDOWN]+[TIMEDOWN],[DAYUP]+[TIMEUP],1,1) AS THD.

Instead of doing the calculation it asks me for "h" which I understand
to be the interval and the proper symbol for hour. What am I doing
wrong?

«Expr» DateDiff («interval», «date1», «date2»,
«firstweekday», «firstweek»)



SQL text:

SELECT WORKORD.DAYDOWN, WORKORD.DAYUP, WORKORD.TIMEDOWN,
WORKORD.TIMEUP, WORKORD.MACHID, WORKORD.EMPLOYEE, WORKORD.ACTION,
WORKORD.REQUEST, WORKORD.COMMENT1, WORKORD.COMMENT2, WORKORD.WONO,
DateDiff([h],[DAYDOWN]+[TIMEDOWN],[DAYUP]+[TIMEUP],1,1) AS THD,
WORKORD.SUBSYS
FROM WORKORD;

Sample Result Data space separated:
DAYDOWN DAYUP TIMEDOWN TIMEUP MACHID EMPLOYEE ACTION REQUEST COMMENT1 COMMENT2 WONO THD SUBSYS
11/3/1998 11/3/1998 8:00 8:20 APT-006 KPM PM PM none none 34743 0 CHD
11/8/1998 11/8/1998 13:00 13:15 APT-014 RC PM PM none none 34745 0 FOC
11/4/1998 11/4/1998 17:15 18:40 ATQ-008 EG PM PM none none 34746 1 CHD
11/3/1998 11/3/1998 11:45 13:15 ATQ-028 WG PM PM none none 34748 2 CHD
 
A

Ant

I think it should be "h" and not [h]


I have a query that selects workorders from a table then trys to
calculate the total hours down by using the function:
DateDiff([h],[DAYDOWN]+[TIMEDOWN],[DAYUP]+[TIMEUP],1,1) AS THD.

Instead of doing the calculation it asks me for "h" which I understand
to be the interval and the proper symbol for hour. What am I doing
wrong?

«Expr» DateDiff («interval», «date1», «date2»,
«firstweekday», «firstweek»)



SQL text:

SELECT WORKORD.DAYDOWN, WORKORD.DAYUP, WORKORD.TIMEDOWN,
WORKORD.TIMEUP, WORKORD.MACHID, WORKORD.EMPLOYEE, WORKORD.ACTION,
WORKORD.REQUEST, WORKORD.COMMENT1, WORKORD.COMMENT2, WORKORD.WONO,
DateDiff([h],[DAYDOWN]+[TIMEDOWN],[DAYUP]+[TIMEUP],1,1) AS THD,
WORKORD.SUBSYS
FROM WORKORD;

Sample Result Data space separated:
DAYDOWN DAYUP TIMEDOWN TIMEUP MACHID EMPLOYEE ACTION REQUEST COMMENT1
COMMENT2 WONO THD SUBSYS
11/3/1998 11/3/1998 8:00 8:20 APT-006 KPM PM PM none none 34743 0 CHD
11/8/1998 11/8/1998 13:00 13:15 APT-014 RC PM PM none none 34745 0 FOC
11/4/1998 11/4/1998 17:15 18:40 ATQ-008 EG PM PM none none 34746 1 CHD
11/3/1998 11/3/1998 11:45 13:15 ATQ-028 WG PM PM none none 34748 2 CHD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top