Hi Steve,

First can you do a sql call and add timestamp to return. Use cast as VARCHAR



Begin SQL
     SELECT RecordID, Mach_ID, Energy_1, Energy_2, Energy_3, TimeStamp
     FROM DMM_TTX_HISTORIAN
     WHERE cast(TimeStamp as VARCHAR)  >= '04/06/2018 07:58:00 AM'
     AND cast(TimeStamp as VARCHAR)  <= '04/06/2018 09:01:00 AM'
     INTO :al_temp1, :at_temp1, :ar_temp1, :ar_temp2, :ar_temp3,
:at_TimStamp
end sql
Does that work

If so add your variables and then try

Regards and hope this helps

Chuck
On Tue, Jul 10, 2018 at 3:03 PM, Stephen J. Orth via 4D_Tech <
[email protected]> wrote:

> Tim,
>
> This is a MS SQL server database and it queries just fine using a static
> timestamp value, as shown below:
>
> Begin SQL
>      SELECT RecordID, Mach_ID, Energy_1, Energy_2, Energy_3
>      FROM DMM_TTX_HISTORIAN
>      WHERE TimeStamp >= '04/06/2018 07:58:00 AM'
>      AND TimeStamp <= '04/06/2018 09:01:00 AM'
>      INTO :al_temp1, :at_temp1, :ar_temp1, :ar_temp2, :ar_temp3
> End SQL
>
> If I run that query I get 4 records returned, which is correct, so I know
> the query if fine.
>
> My problem is now trying to make the static timestamp values being queried
> on dynamic.
>
>
> Steve
>
> -----Original Message-----
> From: Timothy Penner [mailto:[email protected]]
> Sent: Tuesday, July 10, 2018 1:44 PM
> To: [email protected]; '4D iNug Technical' <[email protected]
> >
> Subject: RE: SQL Statement Assistance
>
> There may be multiple things wrong here;
>
> First, is your field actually named TimeStamp?
> If so, this is a SQL Reserved word and shouldn’t be used as a field
> identifier.
>
> Let's start with that first.
>
> -Tim
>
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************




-- 
-----------------------------------------------------------------------------------------
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
       Providers of 4D, Sybase & SQL Server connectivity
          http://www.informed-solutions.com
-----------------------------------------------------------------------------------------
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to