Question on OI to ACCESS SQL syntax (OpenInsight Specific)
At 09 FEB 1999 05:03:31PM Dave Pociu wrote:
I can't seem to find this information anywhere, so I hope someone here has the answer.
One of the fields in an ACCESS table that OI is connected to is a date field. I cannot figure out what is the syntax that a date needs to be passed to ACCESS in.
For example a simplified script like
insert into TestTable
( Id , DateField )
values
( :Id , :DateField ) ;
does not work.
I should point out that the above script works fine for number/ text fields but not for dates.
I also tried to type in the above script in Query Window as follows:
insert into TestTable
( Id , DateField )
values
( 1 , dddddd ) ;
where dddddd was one of the following
02-02-99
'02-02-99'
#02-02-99#
"02-02-99"
990202
'990202'
etc.
I hope someone knows what the right syntax for an Access date field is.
Thanks
Dave Pociu
At 09 FEB 1999 06:01PM Mike Ruane, WinWin Solutions inc. wrote:
Dave-
The following should work:
Insert Into File
(ID, DateField)
values
(101, "12/2/99")
I just cut and paste this from Access into OI and it worked. If you enter your statement from the OI Query Window does it work?
Is your data typing correct?
Hope it helps-
Mike Ruane
WinWin Solutions Inc.
WWW.WinWinSol.Com
At 09 FEB 1999 11:18PM Dave Pociu wrote:
Thanks Mike,
It worked with in the following format:
Insert Into Test
(ID, DateField)
values
(103, '2/2/99');
or
Insert Into Test
(ID, DateField)
values
(104, '2/2/99 2:15PM');
At 16 FEB 1999 01:26PM Cameron Revelation wrote:
David,
(The code modules refer to the connection object/dataset code which can be downloaded from the Works online section.) In OI30ODBC.H, the following are defined:
<code> const char ODBC_DATECONTROL =%Y-%m-%d"; const char ODBC_TIMECONTROL =%H:%M:%S"; const char ODBC_DATETIMECONTROL =%Y-%m-%d %H:%M:%S%f";</code>
You can see the use of each in CONVERT.CPP. According to the ODBC spec, a date is a 4-digit year followed by a dash followed by a 1 or 2 digit month followed by a dash followed by a 1 or 2 digit day. (See the "date-value" construct in Appendix C, "SQL Grammar," of the ODBC Programmers Reference, MS Press.)
I am guessing that (MS) Access is not (MS) ODBC compliant in this regard.
Cameron Purdy
Revelation Software
At 22 FEB 2001 03:15PM Leslie Stewart wrote:
Dave,
I'm sorry that this is not a response to your question, but
you mention in your message that you have an Access table
linked to OI. Have you done this through an ODBC? I'm
desperately trying to figure out how to link the two. I'm
hoping to find a solution that allows me not just to link
data in queries but to create forms (Access) that link to
and show data from OI tables. Any advice you could give me
would be greatly appreciated.
Hope you receive a helpful answer to your question.
Leslie Stewart
hurryjet@med.unc.edu
At 22 FEB 2001 04:05PM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
Responded to an email request via email on this subject.
World Leaders in all things RevSoft