Hi Clay
Two quick things to check:
1. The date value needs to be wrapped in single quotes
2. The date value has to be DD MMM YYYY unless you supply a specific format
ex. TO_DATE('22 JUN 2004')
or TO_DATE('06/22/2004','MM/DD/YYYY')
Incidentally, the same SQL works from the SQL Manager. Sometimes it's easier
for me to debug my SQL from there, and then split it out into my code.
HTH
Steve
"Clay Black" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm not using any Cache COMs, Factory or anything like that. So I just
add
> the To_Date into the SQL statement that is passed to the ODBC connection?
> I'm using only ASP.NET and ODBC for coding, no imports other than the ODBC
> used by ASP.NET. I tried to do it inline like your example and I get this
> when I use the date 2/15/1981:
>
> ERROR [HY000] [Cach� ODBC][State : S1000][Native Code 105]
> [C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe] [SQLCODE:
> <-105>:<Field validation failed in UPDATE>] [Details: <FLoop - func = DU>]
> [%msg: <Field 'DOB' (value '18 May 1846') failed validation>]
>
> Here is my code:
>
> FinDate = MyDate.ToString("yyyy-MM-dd")
> Dim mystring As String = "Update Nothing.Customer set dob = To_Date(" &
> FinDate & "), Name = '" & HName.Text & "', HomeAdd_Street = '" &
haddr.text
> & "', HomeAdd_City = '" & hcity.Text & "', HomeAdd_State = '" &
hstate.text
> & "', HomeAdd_Zip = '" & hzip.text & "', HomePhone= '" & hphone.text & "',
> Email= '" & hemail.text & "' where Name = '" & MyList.SelectedValue & "'"
>
>
>
> "Steve Sutton" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi Clay
> > With my application I do quite a bit of SQL through ODBC.
> > Dates are more cumbersome than other data types, including TimeStamp
> (which
> > you can treat as a string).
> >
> > I've had good success using the SQL Function To_Date() that Cach�
> provides.
> > It allows you to pass a formatting string, but I often use the default
> > format for simplicity.
> >
> > Example for Table OrderHeader, Field ShipDate, if I want to change the
> > ShipDate to 1 May where the ShipDate is currently 1 Jan:
> >
> > UPDATE OrderHeader
> > SET ShipDate = To_Date('01 MAY 2004')
> > WHERE ShipDate = To_Date('01 JAN 2004')
> >
> >
> > It's listed in the SQL docs. I keep the main page as one of my
favorites.
> > You can find it at:
> > http://127.0.0.1:1972/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL
> >
> > if you're not running Cach� on your local machine, replace 127.0.0.1
with
> > the IP address of your server
> >
> > Also, if you ever get back a "date serial" number when using To_Date,
you
> > can nest it inside another To_Date, and it will usually return a
formatted
> > string.
> >
> > Good Luck
> > Steve
> >
> > "Clay Black" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I just completed the Cache Beginners training course and was using
> ASP.NET
> > > to test UPDATE, INSERT, and DELETE commands on Cache. I am using
> > > Dreamweaver as my web development app and I am straight coding it, not
> > using
> > > any wizards,etc. I need to save/update a DOB field, but when I do it
is
> > set
> > > in 1842 or something like that. I understand that $zdh will convert
it
> to
> > a
> > > "friendly" date but how do I do that via ODBC? I thought that it
would
> be
> > > automatic through the Cache Supplied ODBC connector, but it isn't. I
do
> > not
> > > use Cache Factory, just straight ASP coding and ODBC.
> > >
> > > Any help would be greatly appreciated.
> > >
> > >
> >
> >
>
>