I have a datetime field in MS Sql 7.0 named Revised_Date. I can update this date with my datawindow but I can't update it with embedded sql. I have tried the following which doesn't work UPDATE dbo.employees SET revised_date = date() ; produces invalid function error UPDATE dbo.employees SET revised_date = 2000-07-31 ; which yeilds 05/17/05 which is incorrect date ld_date time ldt_datetime ld_date = today ldt_date = datetime(ld_date) UPDATE dbo.employees SET revised_date = :ldt_date; which yields error How can I accomplish this ? Thanks, Andy
![]() |
0 |
![]() |
Your ":ldt_date" example should work. What error are you getting? Have you tried running a PB trace (sqlca.dbms = "trace odbc", or sqlca.dbms = "trace mss") On Mon, 31 Jul 2000 11:30:29 -0400, "Andrew K" <klein@embryominc.com> wrote: >I have a datetime field in MS Sql 7.0 named Revised_Date. I can update this >date with my datawindow but I can't update it with embedded sql. > >I have tried the following which doesn't work > > UPDATE dbo.employees > SET revised_date = date() ; produces invalid function error > > UPDATE dbo.employees > SET revised_date = 2000-07-31 ; which yeilds 05/17/05 which is >incorrect > >date ld_date >time ldt_datetime >ld_date = today >ldt_date = datetime(ld_date) > > UPDATE dbo.employees > SET revised_date = :ldt_date; which yields error > >How can I accomplish this ? > >Thanks, >Andy > >
![]() |
0 |
![]() |
Try this: UPDATE dbo.employees > SET revised_date = GetDate(); Embedded SQL is passed to the SQLServer so you have to use TransactSQL functions -- not PB functions. P.S. You will probably want to include a WHERE clause in the above statement. And don't forget to COMMIT it. Ken
![]() |
0 |
![]() |