I need to calculate a shipping efficency. I have two sets of data, OrderDate and ShipDate, I need to Figure out how long it took each order to ship. Essientially I need to minus the Ship date from the Order date in a new field, entitiled "DaysToShip". I'm new to access, so thank you for the help!!
P.s. If you need more information or I'm not being clear please let me know.
5 7440 NeoPa 32,556
Expert Mod 16PB
Are these two sets of data fields in a single table? The table name would help if so. I'm also assuming you want to create a query to show both the table fields and the calculated field [DaysToShip]. If so, your query would look something like : - SELECT [OrderDate]
-
, [ShipDate]
-
, DateDiff('d',[OrderDate],[ShipDate]) AS [DaysToShip]
-
FROM [YourTable]
As you wand to minus the shipped date I think this code will help you - SELECT [OrderDate]
-
, [ShipDate]
-
, DateDiff('dd',[OrderDate],[ShipDate]-1) AS [DaysToShip]
-
FROM [YourTable]
In Access Query Desing View Try This code, It may work - select DateDiff(dd,OrderDate,ShippedDate)-1
NeoPa 32,556
Expert Mod 16PB
@Roshan.
As you have simply used my suggested code with a couple of minor changes let me just deal with the changes : - You changed 'd' to 'dd'. This simply makes the call fail as 'dd' is not a valid parameter to DateDiff().
- You subtracted one from the calculation. This simply causes the calculation to give an incorrect result.
In your second suggestion you took dd out of the quotes. This simply makes no sense and cannot possibly work (without a predefined object / field named dd which is not the case here).
The sugestion work in case Of MySql Check the code.Thanks for comment
NeoPa 32,556
Expert Mod 16PB
This is an Access question in an Access forum and it doesn't work in Access. I'm pretty sure nothing else is relevant.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard Holliingsworth |
last post by:
Hello:
Thanks for reading this post.
I need to create a metrics (form or report - I don't care which) to
display calculated fields about the database (A2002 front end to SQL
Server 2K)
1) I...
|
by: Judy |
last post by:
I have the following table in part ---
TblClassDate
ClassDateID
CourseID
ClassDate
Classes for courses are held on multiple days. The data for a course in the
table might look like:...
|
by: EdDale |
last post by:
Hi and thanks in advance,
I am using DMin and DMax to calculate date fields in a form.
I need to use these calculated dates in another calculated field.
example:
=DMax("","B&MPayPeriod"," >=...
|
by: Henrik |
last post by:
The problem is (using MS Access 2003) I am unable to retrieve long
strings (255 chars) from calculated fields through a recordset.
The data takes the trip in three phases:
1. A custom public...
|
by: Steve Harp |
last post by:
Hi All,
I'm not sure this can be done in a calculated field but here's what I
need. I have a table that stores time off for employees (such as
vacation, sick time, etc). An employee can take...
|
by: CSmith |
last post by:
I have a calculated field in a query, it calculates the # of days an employee has been employed using the following statement =datediff("d", , NOW()) by default. When an employee is terminated, I...
|
by: myemail.an |
last post by:
I use Access 2007 and create queries with a number of calculated
fields/expressions (I'm still a novice so please forgive me if my
wording is imprecise...), like: MyCalculation = Field1 - Field2.
...
|
by: Greg (codepug |
last post by:
Access 2000
Using a textbox of a single form, I created a calculated field. The
following code is in the Control Source for this field:
=IIf(=24,+(/),/
)
The numbers that are calculated are...
|
by: Nour469 |
last post by:
Hello,
This was supposed to be easy but I could not get it!
I need to create a calculated field in Access (preferably in a table or maybe a query) that calculates the BMI. I have fields for the...
|
by: mkbrady |
last post by:
I have a query that includes calculated fields that generate numeric results.
I have wrapped conversion functions CLng() and CDdl() around the calculated
fields to ensure the data types are...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |