Need to pull records from 6am to 5.59am the nextda

Results 1 to 5 of 5

Thread: Need to pull records from 6am to 5.59am the nextda

  1. #1
    Join Date
    Dec 1969
    Posts
    2

    Default Need to pull records from 6am to 5.59am the nextda

    I have developed an intranet which displays jobs sort of like a job tracking thing. At the moment because the company does shift work I would like to diplay records from 6am to 5.59am the following day this is the code at the moment which displays jobs from 0001 to 0000 the following day<BR><BR>SELECT Clients.ClientName, Job.JobNumber, Job.ClientID, Job.JobTitle,Job.JobID, Job.JobPages, Job.JobColours, Job.JobTimeIn, Job.JobBagIn, Job.JobTx, Job.JobImposed, Job.JobPlated, Job.JobSite, Job.OtherInfo, Job.StatusID, Status.Status, (PrepressUsers.UFName&&#039; &#039;&PrepressUsers.USName) As PrepressUser, PrepressUsers.UserID<BR>FROM Status INNER JOIN (PrepressUsers INNER JOIN (Clients INNER JOIN Job ON Clients.ClientID = Job.ClientID) ON PrepressUsers.UserID = Job.UserID) ON Status.StatusID = Job.StatusID<BR>WHERE (((Job.TimeStamp)&#062;=Date()-1))<BR>ORDER BY Clients.ClientName;<BR><BR>Please Help<BR><BR>Clement<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    96,118

    Default What DB? Looks like Access?

    You *could* do the query all in Access, but it would be a royal pain.<BR><BR>I&#039;d mix VBS and Access, thus:<BR><BR>&#060;%<BR>today = CDate( Date() + TimeSerial(6,0,0) )<BR>yesterday = CDate( Date()-1 + TimeSerial(6,0,0) )<BR><BR>SQL = "SELECT ... " _<BR> & " WHERE Job.TimeStamp &#062;= #" & yesterday & "# AND Job.TimeStamp &#060; #" & today & "#" _<BR> & ...<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    2

    Default RE: What DB? Looks like Access?

    It is in access but I&#039;m using dreamweaver mx to pull the records I&#039;ll try the expression but I&#039;m no expert in ASP are the &#039;#&#039; symbols to be replaced?

  4. #4
    Join Date
    Dec 1969
    Posts
    2,334

    Default nope

    that should work as it is.


  5. #5
    Join Date
    Dec 1969
    Posts
    96,118

    Default You *MUST* use #...# in Access...

    ...to indicate a "literal date".<BR><BR>Actually, it&#039;s the same in VBScript. Not surprising, since both use a variation on Visual Basic as a starting point for their languages.<BR><BR>I might note that Access is further limited to *ONLY* understanding #mm/dd/yy hh:mm:ss ap# format.<BR><BR>That is, you can&#039;t give it #dd/mm/yy#. It will always interpret #3/5/2002# as March 5th, 2002. This is USA standard, and Access hasn&#039;t yet joined the "international" world as well as it could.<BR><BR>(There are ways around this; ask if you need them.)<BR><BR>(VBScript, in ASP, on the other hand *will* understand either format if you have set the Session.LCID properly.)<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •