A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

timestamp handle



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2009, 10:17 PM posted to microsoft.public.access.queries
R Walle[_2_]
external usenet poster
 
Posts: 1
Default timestamp handle

I have a database automatically created for a GE SCADA software, it creates
a table with datalogging from the proccess , one column for each datafield is
being logged and a [timestamp] field formated (mm/dd/aaaa hh:mm:ss) now I
want to make some reports based on dates ranges lets say by days or mounths
, but since timestamp is deep to seconds if I use a date(dd/mm/aaaa) as query
parameter / filter I get no query results Im afraid because timestamp data
formating even if I formating this timestamp field to display short date or
any other date format the result is te same , any idea about handle this
[timestamp] field ?

Tks in advance for your help
Raymundo Walle
  #2  
Old December 7th, 2009, 10:34 PM posted to microsoft.public.access.queries
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default timestamp handle

You need to use

WHERE [TimestampField] BETWEEN [MyDateValue] AND DateAdd("s", 86399,
[MyDateValue])

The alternative (which is much less efficient, since the function needs to
be applied to each row) is

WHERE DateValue([TimestampField]) = [MyDateValue]

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"R Walle" wrote in message
...
I have a database automatically created for a GE SCADA software, it
creates
a table with datalogging from the proccess , one column for each datafield
is
being logged and a [timestamp] field formated (mm/dd/aaaa hh:mm:ss) now I
want to make some reports based on dates ranges lets say by days or
mounths
, but since timestamp is deep to seconds if I use a date(dd/mm/aaaa) as
query
parameter / filter I get no query results Im afraid because timestamp data
formating even if I formating this timestamp field to display short date
or
any other date format the result is te same , any idea about handle this
[timestamp] field ?

Tks in advance for your help
Raymundo Walle



  #3  
Old December 8th, 2009, 12:05 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default timestamp handle

I would just use
WHERE TimeStampField = [DateValue] and TimeStampField [DateValue]+1

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Douglas J. Steele wrote:
You need to use

WHERE [TimestampField] BETWEEN [MyDateValue] AND DateAdd("s", 86399,
[MyDateValue])

The alternative (which is much less efficient, since the function needs to
be applied to each row) is

WHERE DateValue([TimestampField]) = [MyDateValue]

  #4  
Old December 8th, 2009, 01:35 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default timestamp handle

Well, that was just a repeat of Douglas Steele's advice. I need to read more
carefully.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

John Spencer wrote:
I would just use
WHERE TimeStampField = [DateValue] and TimeStampField [DateValue]+1

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Douglas J. Steele wrote:
You need to use

WHERE [TimestampField] BETWEEN [MyDateValue] AND DateAdd("s", 86399,
[MyDateValue])

The alternative (which is much less efficient, since the function
needs to be applied to each row) is

WHERE DateValue([TimestampField]) = [MyDateValue]

  #5  
Old December 9th, 2009, 10:34 PM posted to microsoft.public.access.queries
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default timestamp handle

Actually, you need to type more carefully too. g

I believe you meant to say

WHERE TimeStampField = [DateValue] and TimeStampField [DateValue]+1


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"John Spencer" wrote in message
...
Well, that was just a repeat of Douglas Steele's advice. I need to read
more carefully.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

John Spencer wrote:
I would just use
WHERE TimeStampField = [DateValue] and TimeStampField [DateValue]+1

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Douglas J. Steele wrote:
You need to use

WHERE [TimestampField] BETWEEN [MyDateValue] AND DateAdd("s", 86399,
[MyDateValue])

The alternative (which is much less efficient, since the function needs
to be applied to each row) is

WHERE DateValue([TimestampField]) = [MyDateValue]



  #6  
Old December 10th, 2009, 02:48 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default timestamp handle

That also. Sometimes I can't win. Sometimes I can.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Douglas J. Steele wrote:
Actually, you need to type more carefully too. g

I believe you meant to say

WHERE TimeStampField = [DateValue] and TimeStampField [DateValue]+1


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.