Re: Access Query - DateTime

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Access Query - DateTime
    ... 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 ...
    (microsoft.public.access.gettingstarted)
  • 16 bit subsystem/Ntvdm subsystem--HELP
    ... I am having a lot of trouble accessing programs that two ... The error message says ... 16 bit Windows Subsystem ...
    (microsoft.public.windowsxp.general)
  • Re: lsass.exe or is it isass.exe
    ... I've been having trouble getting around a boot up problem. ... I get the error message "lsass.exe - Bad File The attributes of the ... done some searching on the internet and find that windows has a patch ... for this problem and that my system may be infected with virus. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: ICSharpCode.SharpZipLib.GZip.GZipInputStream Use with HTTP Request
    ... I am having trouble getting the decoded text. ... > sample code, I keep encountering an error message about the first byte ... > has a gzipped body? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: I can only send email by replying to a received email (Outlook 20.
    ... I can receive with no trouble. ... The only error message I receive is as follows: ... > folders sending and receiving reported error This task was ... > I certainly did not cancel this task. ...
    (microsoft.public.outlook.general)