How can I update an MS SQL 7.0 datetime field with embedded sql

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
Andrew
7/31/2000 3:30:29 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

2 Replies
694 Views

Similar Articles

[PageSpeed] 1

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
NOSPAM_matthewc
8/1/2000 8:53:30 PM
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
kbreneman
9/26/2000 12:13:25 AM
Reply:

Web resources about - How can I update an MS SQL 7.0 datetime field with embedded sql - sybase.powerbuilder.datawindow

Is there a JQuery plugin to convert UTC datetimes to local user timezone?
If I have a tag: &lt;span class="utctime"&gt;2010-01-01 11:30 PM&lt;/span&gt; I would like a jquery script or plug in to convert every utctime ...


Targetprocess 3.7.3: Epic unit for Bug/Story cards, new DateTime functions in Webhook plugin
Webhook plugin supports new DateTime functions AddDays(DateTime date, int days) – Returns a new date with the number of days added. The number ...

Common Pitfalls when working with DateTime’s
In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you ...

Parsing Twitter Date format to .Net DateTime
Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, ...

C Sharp (programming language) - Wikipedia, the free encyclopedia
(pronounced see sharp ) is a multi-paradigm programming language encompassing strong typing , imperative , declarative , functional , generic ...

1753 - Wikipedia, the free encyclopedia
Language: English Afrikaans አማርኛ العربية Aragonés Asturianu Aymar aru Azərbaycanca বাংলা Bân-lâm-gú Basa Banyumasan Беларуская ‪Беларуская (тарашкевіца)‬ ...

Coded Smorgasbord: Schizophrenic Haiku Comments and More
... writes Malcom StandardResponse UnSubscribeNewsletterUserAccount( string opTinGUID,string email, string sellingRegion, string source, DateTime ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Simples Ideias. Por Nando Vieira.
Simples Ideias Siga-me no Twitter Junho/2012 Usando o Vagrant como ambiente de desenvolvimento no Windows http://simplesideias.com.br/usando ...

Resources last updated: 12/29/2015 7:02:49 PM