03-25-2009 12:12 AM
Mike,
I'm attempting to insert a the date in mm/dd/yyyy format in the first column. I've been told the TODAY() and NOW() will only provide a numerical value. I think an option is inserting one text that includes 3 pots. One pot for the month, one for the day, one for the year. Between each pot use a /. However I'm not sure what the proper syntax is when I enter it in the SQLExec object expression. The pots will be assigned the system values (i.e PC date)
I appreciate your help
Thank you,
Hank
03-25-2009 10:55 AM
Here is what you need to get there: http://zone.ni.com/devzone/cda/epd/p/id/1400
That is an example of splitting the month, day, year, hour, minute and seconds into seperate objects.
Also, Access date format is inserted between #. #03/25/2009 13:34:54#
Mike
03-30-2009 02:34 PM
Mike,
I have got the SQLExec expression to work - no syntax errors. I created MDB table and defined the fields in access. However when I execute the expression it gives me an error on the Alarms Window in the ODBC area: [Not Buffered] 2300/-1053: [Microsoft][ODBC Microsoft Access Driver] Index or primary key cannnot contain Null value..
Hank
03-30-2009 03:34 PM
03-30-2009 03:56 PM
Below is the sytnax used to send data to the table H13_Daily_Totals. The corresponding fields' datatype is a number (field size=long integer)
The process name is "MAIN"
SQLExec expression: "INSERT INTO H13_DAILY_TOTALS (CHEM_TOTALS, WEIGHT_TOTALS, WATER_TOTALS, DEL_TOTALS, RATIO, TEMP_AVG, CONVEYOR_RUN, CONVEYOR_OFF, CONVEYOR_STOPS) VALUES ("&\\.\MAIN\DL1.H1_CHEM_TOTAL&", "&\\.\MAIN\DL1.H1_WEIGHT_TOTAL&", "&\\.\MAIN\DL1.H1_WATER_TOTAL&", "&\\.\MAIN\DL1.H1_DEL&", "&\\.\MAIN\DL1.H1_RATIO&", "&\\.\MAIN\DL1.H1_TEMP_AVERAGE&", "&\\.\MAIN\DL0.CONVEYOR_RUNTIME&", "&\\.\MAIN\DL0.CONVEYOR_OFFTIME&", "&\\.\HOUSE1\DL1.H1_CONV_STOPS&")"
03-30-2009 03:58 PM - edited 03-30-2009 03:59 PM
What field is the primary key?
Id suggest a seperate column simply called rowIndex as an autonumber
mike
03-30-2009 04:15 PM
When I originally created the table, I did not select a field as the primary key. Does the field "RowIndex" need to be the first column? How does the autonumber data type function?
03-30-2009 04:43 PM
It can be any column over, first, middle, last.
Simply create a new column and set the field as an autonumber. Then set as the primary key.
Mike
03-30-2009 05:19 PM
The error is gone, but no values were inserted in the fields. Just "0" I re-executed the command and did not create an extra row of values.