Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2006

Tip: Looking for answers? Try searching our database.

calculated field in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cporter@dallas.photronics.com - 23 Mar 2006 21:06 GMT
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
Ant - 25 Mar 2006 15:06 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.