EditMask Style on DateTime (Oracle) Field Yields 01/01/1900 Date

I am running PB7 over an Oracle 7.3 database.  I have set the EditMask style
on my datetime fields to 'MM/DD/YYYY', have set a Format (Display)  of
'MM/DD/YYYY,' and have set the 'Use Format' property on the Edit property
tab.  Everything works beautifully until I erase an entered value from the
field by highlighting and pressing the Delete key.  When I tab off the
field, the date '01/01/1900' populates the field.

From the on-line help, I have found that 01/01/1900 displays when there is
an error in a date function--when an incorrect format is used.  When I
change the EditMask format to dd-mmm-yy (to match the default Oracle
format), the problem does not occur--I can tab off of the field and it
remains blank--so it seems that the problem has to do with a format
inconsistency when PowerBuilder tries to reset my 00/00/0000 format in place
of an erased date.  How do I override the dd-mmm-yy format that
PowerBuilder/Oracle seems to want it these cases?   'Working around' the
problem by using the dd-mmm-yy format is not an option.




0
Monica
3/17/2000 7:15:10 PM
sybase.powerbuilder.datawindow 28057 articles. 5 followers. Follow

2 Replies
1193 Views

Similar Articles

[PageSpeed] 23

You can set the proper NLS_DATE_FORMAT in your application.
ls_sql = 'alter session set nls_date_format = ....'

--
Terry Dykstra (TeamSybase)
Canadian Forest Oil Ltd.
Check out Sybase Developer's Network: http://www.sybase.com/sdn

Monica Resor <resorm@systemetrix.com> wrote in message
news:DKqteYEk$GA.201@forums.sybase.com...
> I am running PB7 over an Oracle 7.3 database.  I have set the EditMask
style
> on my datetime fields to 'MM/DD/YYYY', have set a Format (Display)  of
> 'MM/DD/YYYY,' and have set the 'Use Format' property on the Edit property
> tab.  Everything works beautifully until I erase an entered value from the
> field by highlighting and pressing the Delete key.  When I tab off the
> field, the date '01/01/1900' populates the field.
>
> From the on-line help, I have found that 01/01/1900 displays when there is
> an error in a date function--when an incorrect format is used.  When I
> change the EditMask format to dd-mmm-yy (to match the default Oracle
> format), the problem does not occur--I can tab off of the field and it
> remains blank--so it seems that the problem has to do with a format
> inconsistency when PowerBuilder tries to reset my 00/00/0000 format in
place
> of an erased date.  How do I override the dd-mmm-yy format that
> PowerBuilder/Oracle seems to want it these cases?   'Working around' the
> problem by using the dd-mmm-yy format is not an option.
>
>
>
>


0
Terry
3/17/2000 10:04:32 PM
Thanks for the suggestion.  Unfortunately, it does not seem to work.  I
altered the NLS_DATE_FORMAT to 'MM/DD/YYYY HH:MI:SS, and confirmed that the
ALTER statement took via Oracle's V$NLS_PARAMETERS view.  But, the problem
persists...  Any further suggestions would be appreciated.

Terry Dykstra wrote in message ...
>You can set the proper NLS_DATE_FORMAT in your application.
>ls_sql = 'alter session set nls_date_format = ....'
>
>--
>Terry Dykstra (TeamSybase)
>Canadian Forest Oil Ltd.
>Check out Sybase Developer's Network: http://www.sybase.com/sdn



0
Monica
3/20/2000 2:29:27 PM
Reply:

Similar Artilces:

Updating database date field results in date value of "01/01/1900"
Brand new to this, so please bear with me.I'm using the following code fragment to update a datetime field on a SQL Server 2005 database table:cmd.CommandText = "Update Projects Set EntryDate = " & Convert.ToDateTime(txtEntryDate.Text)cmd.ExecuteNonQuery()The result of the update operation is the the database field contains the value "1900-01-01 00:00:00:000".  This probably means that I passed nulls to SQL; however, I see a valid date in the txtEntryDate field on my web form (i.e., "06/18/2007").  I also did a "Response.write" t...

date is 01/01/1900
I'm updating a row in sql2k and its updating my date field to 01/01/1900 no matter what I specify. Am I doing this correctly: UPDATE Purchase SET DOP = 25/03/2003 WHERE Code = 'code02' I'm using query analyzer also, same thing, although row updated successfully is 1. > UPDATE Purchase SET DOP = 25/03/2003 WHERE Code = 'code02' try : UPDATE Purchase SET DOP = '25/03/2003' WHERE Code = 'code02' or in access UPDATE Purchase SET DOP = #25/03/2003# WHERE Code = 'code02' though I usually try to use non-ambiguos date formats e.g. UPDATE Purchase SET DOP = '25 Mar...

date is 01/01/1900
I am using PB12.1 and MS SQL Server 2008 R2 Express , and I am connect through SNC I have code like::- ls_date = "28/12/2010" format is dd/mm/yyyy date ldt_date ldt_date = date(ls_date) but it gives date=01/01/1900 it means null date and in control panel\reginal setting I change date format to dd/mm/yyyy but problem still, could any one help me thanks I just answered this question in the general section. Please don't crosspost - answers are more useful if the discussion is all in one place. Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do ...

date is 01/01/1900
I am using PB12.1 and MS SQL Server 2008 R2 Express , and I am connect through SNC I have code like::- ls_date = "28/12/2010" format is dd/mm/yyyy date ldt_date ldt_date = date(ls_date) but it gives date=01/01/1900 it means null date and in control panel\reginal setting I change date format to dd/mm/yyyy but problem still, could any one help me thanks That says the input was not recognized as a valid format - null input would return null. It's a better practice to use PB's date literal format "yyyy-mm-dd" to avoid problems, as the control panel se...

Default Date 01/01/1900 ro current date
Is there a way to change the PB default date of 01/10/1900? Is it a built-in setup or is there a setting I can change to make it use the current date instead of 10/10/1900? Thanks for your help! No. I believe PB uses an "epoch" integer for internal date storage, and 01-jan-1900 is what 0 translates to. You're just going to have to initialize ate variables as needed. <Anna> wrote in message news:4238932b.391a.1681692777@sybase.com... > Is there a way to change the PB default date of 01/10/1900? > Is it a built-in setup or is there a setting I can change t...

1900/01/01 date issue
Hi, I have two date fields(date1 and date2) on a dw, both with editmasks in yyyy/mm/dd format. When the user enters 0000/00/00 in the first date field (date1), debugger shows date1's value as 1900/01/01 - the default value for invalid dates as I understand. The application has processing in the itemchanged event of this dw to SetNull date2 if date1 = 1900/01/01 and if not, do some processing and display a new date in date2. Is there a standard work around to allow the user to enter 1900/01/01 in date1, check for invalid dates, and still allow normal processing (perform the ca...

Hide 1900-01-01 date in GridView
I use a Calendar in a GridView. I found the Calendar does not like the NULL from the database so I replaced NULL by SqlDateTime.Null which is actually the date 1900-01-01. So now I see 1900-01-01 in the GridView. How could I replace 1900-01-01 by nothing in the GridView ? Hi Guy,  I have done something similar with the following code using the pre render event for the grid view:   Protected Sub GridView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.PreRender For Each r As GridViewRow In GridView1.Rows If r.Cells(<da...

Date function return 1900/01/01
I have a datetime column. I want to get it value and compare to another datetime column. Here is my script in itemchanged datetime ldt_source, ldt_target string ls_date ls_date = gettext() ====> return 2002/10/16 00:00:00 ldt_source = date(ls_date) ====> return 1900/01/01 How do I convert a string to date, ref to help. It is using date(). But it return 1900/01/01 It's strange that you don't get a compile error. ldt_source is datetime In that case you should do something like: ldt_source = Datetime(Date(ls_date)) What you can always do is strip of the t...

Convert 01-01-1900 Date string value to NULL
Hi   I have a number of Textboxs on a Formview.   The Textboxs contains Date values.   When I update these dates are saved to SQL Default 1/1/1900.   I know I have to Convert Date string value to NULL before UPDATE query is executed Or write a trigger to replace 1/1/1900 values to null   I cannot find a way of converting Date back to NULL.   Also, I have only written very simple triggers.   Could anyone help me on to how to achieve the above?   Thanks in advance.   Using VB 2005/SQL 2005 Have default datetime value i...

Set dateTime variable to 01/01/1900 00:00
Just a very simple question and I know most of you may be able to answer this. I want to set the value for a datetime variable to 01/01/1900 00:00 (the format of this is dd/MM/yyyy hh:mm). I try to do this using the following code: Dim strDate as String = "01/01/1900 00:00"Dim ciCultureInfo As New CultureInfo("en-GB") Dim dtDate as DateTime = Convert.ToDateTime(strDate, ciCultureInfo) I get the error: String was not recognized as valid date time. Can someone help me out on this?  Basically, I just need to set the value for the dtDate variable to 01/01/1900 00:0...

Null date textbox returns 01/01/1900 instead of null
VS 2005, SQL Server 2000 For the following textbox, if the textbox is blank when I do an update, it returns 01/01/00 (which is 01/01/1900).  Is there a way to prevent it from entering a value when it should be null, or do I need to do a check in the Updating event? <asp:TextBox ID="ResolvedDate" Text='<% #Bind("ResolvedDate","{0:MM/dd/yy}")%>'  runat="server" ></asp:TextBox>   I'm a little confused... Do you mean, when the page loads, the textbox has 01/01/1900... OR do you mean, when the page post...

Strange empty mail dated 1970-01-01 01:00
Hello In my Thunderbird 2.0.0.23 sometimes appears empty mails dated 1970-01-01. I can only delete them by rebuilding folder index. I created new profile but problem stayed. Could someone help. Best regards Slawek Poland __________ Informacja programu ESET NOD32 Antivirus, wersja bazy sygnatur wirusow 4465 (20090928) __________ Wiadomosc zostala sprawdzona przez program ESET NOD32 Antivirus. http://www.eset.pl lub http://www.eset.com Slawek wrote: > Hello > In my Thunderbird 2.0.0.23 sometimes appears empty mails dated 1970-01-01. I > can only del...

error accessing DateTime value of e.g. 01-01-0011 from oracle [Edit]
When accessing a oracle 10g table holding datetime fields with a value of e.g. 01-01-0011 i get an error as soon as the adodataset component tries to retrieve the data from this field. Either using ora or ms provider makes no difference. When it gets to the TCustomADODataSet.GetFieldData function the Recordset.Fields[Field.FieldNo-1].Value statement fails. Does this mean that oledb can't handle any datetime value before 30-12-1899? tia willem mooi wilten > {quote:title=Willem Mooi Wilten wrote:}{quote} > When accessing a oracle 10g table holding datetime fields with a value o...

display DB default (1900-01-01 00:00:00.000) datetime in gridview as blank
Hi there and thanks in advance for any answer. I have a db table where I store production task items. In that table I have a field which is a datetime. I'm currently displaying the production tasks on a gridview. My problem is that when the manager does not specify a the datetime when he first fills out the order form, on the gridview I get the infamous 1900-01-01 00:00:00.000 db default time, and thats just nice.  Is there a way to simply display blank?? Or is there a way to input blank or null to the db?? Adam How are you inserting the records into the database if nothing i...

Web resources about - EditMask Style on DateTime (Oracle) Field Yields 01/01/1900 Date - sybase.powerbuilder.datawindow

Resources last updated: 12/27/2015 6:49:36 AM