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!

Returning an Average

Status
Not open for further replies.

mattpv

IS-IT--Management
Nov 6, 2001
41
US
OK I have a shipping dB. I have several data fields, only 3 are important for this.
1) Date_Shipped_out
2) Carrier
3) Date returned

Items 1 and 3 are in date format. (11/01/01)

I have a query that I want to subtract the date_shipped_out from the Date_returned and get the # of days between the 2 days.

Here is the code in the query I am using:
(Select Datediff("d", [Date_Shipped],- [Date_Returned]) As Num_Of_Days From [Shipping Authorization Log Sheet])
This is not working for me.
I would appreciate any and all help to resolve this issue.
Thanks a Million in advance...
 
Make sure you are referencing actual field names. Also, delete the - from in front of [Date_Returned]:

Select Datediff("d", [Date_Shipped_out],[Date_Returned]) As Num_Of_Days From [Shipping Authorization Log Sheet]
 
You show a minus sign ('-') in front of [Date_Returned] in the SQL you've posted. If that's in your original, try taking it out. -- Herb
 
SELECT Table1.Date1, Table1.Date2, DateDiff("d",[Date1],[Date2]) AS Num_Of_Days
FROM Table1;

seems to work Ok for me... check the "-" symbol... htwh Steve Medvid
"IT Consultant & Web Master"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top