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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|