1 Reply Latest reply on Jun 12, 2015 9:49 AM by philmodjunk

    SQL statement issue??



      SQL statement issue??


      Hello. and thanks for having a look:

      Im trying to send an SQL statement to FileMaker using Labviews  SQL.

      If I configure my data base fields all as data type "Text", all is fine; but if I configure _DATE_TIME to be a "Timestamp" using the following code:

      INSERT INTO  "GPS CN Test"  ("_DUT", "_TYPE", "_SWVER", "_DATE_TIME", "_TEST", "_STATUS", "0.00")  VALUES  ('3KA000071', ' ', ' ', '03/04/2015 10:37:13', 'GPS CN Test', ' ', '60.00')  

      I get an error  
      FQL0013/(1:108): Incompatible types in assignment. in ADO Connection Execute.vi->Insert into a Table.vi

      As I say, if i change _DATE_TIME data type to "Text", the statement works which would indicate the format im putting into the field is wrong, but I cant see anything wrong with the format (03/04/2015 10:37:13)

      Any ideas

      Thanks in advance



        • 1. Re: SQL statement issue??

          A timestamp in FileMaker internally stores it's value as the number of seconds elapsed from Midnight, 1/1/0001 to the date time shown. It's not stored in the format you have set up in your SQL query. Using what you have, you'd have to insert the value as text into a text field and then use GetAsTimeStamp to convert the value into a timestamp and copy the converted value into your timestamp field.

          I'm not familiar with "LabViews", but FileMaker SQL has a function that converts such a quoted string into a time stamp:

          TIMESTAMPVAL('2015-03-05 10:37:13')