Date criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I hope someone can help me. I have a Projects table I would like
to query on 2 date columns. I want to calculate the difference between
the "requested delivery date" and "shipment date" columns. In order to see
which orders were delivered late. I want this to come up automatically
when I open a query to retrieve all late orders.
Thanks in advance
Mix
 
In the Field row in query design enter:
Days: DateDiff("d", [requested delivery date], [shipment date])

You can specify a number in the Criteria row if you want just late orders,
e.g.:
 
Hi Allen

I have tried that expression, it asks for the parameters of the 2 dates,
these are however not known when you start the query. I want all complient
records to come up (all late deliveries). I have tried using the greater than
sign in an expression, this however does not get accepted in the expression.

Allen Browne said:
In the Field row in query design enter:
Days: DateDiff("d", [requested delivery date], [shipment date])

You can specify a number in the Criteria row if you want just late orders,
e.g.:

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mix said:
Hi. I hope someone can help me. I have a Projects table I would like
to query on 2 date columns. I want to calculate the difference between
the "requested delivery date" and "shipment date" columns. In order to see
which orders were delivered late. I want this to come up automatically
when I open a query to retrieve all late orders.
Thanks in advance
Mix
 
Replace the names:
[requested delivery date]
and
[shipment date]
with the actual names of the fields you wish to work with.

Access assumes they are parameters if the names do not match the names of
your fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mix said:
Hi Allen

I have tried that expression, it asks for the parameters of the 2 dates,
these are however not known when you start the query. I want all complient
records to come up (all late deliveries). I have tried using the greater
than
sign in an expression, this however does not get accepted in the
expression.

Allen Browne said:
In the Field row in query design enter:
Days: DateDiff("d", [requested delivery date], [shipment date])

You can specify a number in the Criteria row if you want just late
orders,
e.g.:

mix said:
Hi. I hope someone can help me. I have a Projects table I would like
to query on 2 date columns. I want to calculate the difference between
the "requested delivery date" and "shipment date" columns. In order to
see
which orders were delivered late. I want this to come up automatically
when I open a query to retrieve all late orders.
Thanks in advance
Mix
 
Thanks so much Allen! It worked. Do you have any idea how to display the
query results in a form, instead of viewing the results in a table format??

Allen Browne said:
Replace the names:
[requested delivery date]
and
[shipment date]
with the actual names of the fields you wish to work with.

Access assumes they are parameters if the names do not match the names of
your fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mix said:
Hi Allen

I have tried that expression, it asks for the parameters of the 2 dates,
these are however not known when you start the query. I want all complient
records to come up (all late deliveries). I have tried using the greater
than
sign in an expression, this however does not get accepted in the
expression.

Allen Browne said:
In the Field row in query design enter:
Days: DateDiff("d", [requested delivery date], [shipment date])

You can specify a number in the Criteria row if you want just late
orders,
e.g.:
= 7

Hi. I hope someone can help me. I have a Projects table I would like
to query on 2 date columns. I want to calculate the difference between
the "requested delivery date" and "shipment date" columns. In order to
see
which orders were delivered late. I want this to come up automatically
when I open a query to retrieve all late orders.
Thanks in advance
Mix
 
HI

Found it in a previous post.
Thanks
Mix

mix said:
Thanks so much Allen! It worked. Do you have any idea how to display the
query results in a form, instead of viewing the results in a table format??

Allen Browne said:
Replace the names:
[requested delivery date]
and
[shipment date]
with the actual names of the fields you wish to work with.

Access assumes they are parameters if the names do not match the names of
your fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

mix said:
Hi Allen

I have tried that expression, it asks for the parameters of the 2 dates,
these are however not known when you start the query. I want all complient
records to come up (all late deliveries). I have tried using the greater
than
sign in an expression, this however does not get accepted in the
expression.

:

In the Field row in query design enter:
Days: DateDiff("d", [requested delivery date], [shipment date])

You can specify a number in the Criteria row if you want just late
orders,
e.g.:
= 7

Hi. I hope someone can help me. I have a Projects table I would like
to query on 2 date columns. I want to calculate the difference between
the "requested delivery date" and "shipment date" columns. In order to
see
which orders were delivered late. I want this to come up automatically
when I open a query to retrieve all late orders.
Thanks in advance
Mix
 
Back
Top