Only store the date to the closest second, rather than millisecond.

> Is there a way to write a query which groups together slightly differeing 
> times - the current query is
> 
> Select  Snapshot_date, Count(Table1.Snapshot_date) from Table1
> Group by Snapshot_Date
> 
> The problem is that the table is updated by a stored procedure which is very 
> fast, but does take a few milliseconds to run so the Group By usually 
> produces 2 or 3 lines.
> 
> Is there either:
> 1 - a way to query so that the group by does not care about say a 1 second 
> discrepancy?
> 
> 2 - Or Alternatively a way to force the exact same date/time into the stored 
> procedure below - I guess it would mean
> replacing the 'NOW' parameter below with a fixed Date/Time set at the 
> beginning of the stored procedure...
> 
> In the stored procedure the code uses a subquery - simplified essence is as 
> below:
> 
> BEGIN
>  FOR SELECT
> Table2.Field1 as Param1,
> Table3.Field2 as Param2
> FROM Table2,Table3
> 
> WHERE
> ......
> .......
> ......
> INTO
> :Param1,
> :Param2
> 
> DO
> BEGIN
> Select
> Insert into Table1
> (Field1,
> Field2,
> Snapshot_date)
> VALUES
> (:param1,
> :Param2,
> 'NOW')
> END
> 
> SUSPEND
> 
> 
> John
> John Bird
> JBCL
> Contact:
> [email protected]
> 03-3844527,  027 4844528
> http://jbclnz.googlepages.com
> http://www.jbcl.co.nz
> ----- Original Message ----- 
> From: "PDS - John" <[email protected]>
> To: "'NZ Borland Developers Group - Offtopic List'" 
> <[email protected]>
> Sent: Wednesday, November 11, 2009 4:15 PM
> Subject: Re: [DUG-Offtopic] Small favour
> 
> 
>> Hi Peter
>>
>> I would be interested too what others think about this issue, so please do
>> NOT response offlist, thanks:)
>>
>> This issue is similar to mine on the DUG list "Re: [DUG] HELP! : Windows7 
>> 64
>> bits - Delphi install issues".
>>
>> John
>>
>>
>>
>>> -----Original Message-----
>>> From: [email protected] [mailto:offtopic-
>>> [email protected]] On Behalf Of Peter Hyde
>>> Sent: Wednesday, 11 November 2009 3:40 p.m.
>>> To: [email protected]
>>> Subject: [DUG-Offtopic] Small favour
>>>
>>> Hi there,
>>>   I wonder, is anyone out there running Win7/64 bit and has time to
>>> do a brief install/runs check for me?
>>>
>>> Virtual chocolate fish for the first response. Or a TurboNote+
>>> product licence, whichever you prefer <g>.
>>>
>>> Please respond offlist, thanks!
>>>
>>> cheers,
>>> peter
>>>
>>>
>>> _______________________________________________
>>> NZ Borland Developers Group Offtopic mailing list
>>> Post: [email protected]
>>> Admin: http://delphi.org.nz/mailman/listinfo/offtopic
>>> Unsubscribe: send an email to [email protected]
>>> with Subject: unsubscribe
>>
>> _______________________________________________
>> NZ Borland Developers Group Offtopic mailing list
>> Post: [email protected]
>> Admin: http://delphi.org.nz/mailman/listinfo/offtopic
>> Unsubscribe: send an email to [email protected] with 
>> Subject: unsubscribe 
> 
> 
> _______________________________________________
> NZ Borland Developers Group Offtopic mailing list
> Post: [email protected]
> Admin: http://delphi.org.nz/mailman/listinfo/offtopic
> Unsubscribe: send an email to [email protected] with 
> Subject: unsubscribe
> 

_______________________________________________
NZ Borland Developers Group Offtopic mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/offtopic
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to