Re: Access Query - DateTime
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Thu, 24 Nov 2005 19:36:58 GMT
Fritz Switzer wrote:
> I have a DateTime field in my Access table named AuditTime.
>
> I'm having trouble creating a SQL query that will return all records
> that are "older" than 12 hours. I've tried different variations of
> the following:
>
> SELECT *
> FROM Charts
> WHERE (DATEDIFF('hh', [ AuditTime], NOW()) = '12')
>
> "No value given for one or more parameters" is the error message.
SELECT *
FROM Charts
WHERE DATEDIFF('hh', [AuditTime], NOW()) > 12)
DateDiff return an integer so no quotes. Plus "=" would only return records
that are exactly 12 hours old.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
.
- Follow-Ups:
- Re: Access Query - DateTime
- From: Fritz Switzer
- Re: Access Query - DateTime (CORRECTION)
- From: Rick Brandt
- Re: Access Query - DateTime
- References:
- Access Query - DateTime
- From: Fritz Switzer
- Access Query - DateTime
- Prev by Date: Access Query - DateTime
- Next by Date: Re: Access Query - DateTime (CORRECTION)
- Previous by thread: Access Query - DateTime
- Next by thread: Re: Access Query - DateTime (CORRECTION)
- Index(es):
Relevant Pages
|