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
0
finestraco
12/28/2010 11:47:52 AM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

6 Replies
1078 Views

Similar Articles

[PageSpeed] 22

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 setting is 
the user's choice for all programs and shouldn't be altered for one 
specific application or expected to be any particular value.

Report Bugs to Sybase:  http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

On 12/28/2010 6:47 AM, finestraco wrote:
> 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
0
Jerry
12/28/2010 12:12:15 PM
Should I change date format in control panel or my
application ?
Thanks for your replay

finestraco

> 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 setting is  the user's
> choice for all programs and shouldn't be altered for one
> specific application or expected to be any particular
> value.
>
> Report Bugs to Sybase:
> http://case-express.sybase.com/cx/welcome.do Product
> Enhancement Requests:
> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>
> On 12/28/2010 6:47 AM, finestraco wrote:
> > 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
0
finestraco
12/28/2010 3:10:04 PM
You should change the way you specify date literals in your application. 
The system's current default format (set in control panel) would only be 
used if you specify a display format as {ShortDate] or [LongDate] and 
maybe [General].

Report Bugs to Sybase:  http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

On 12/28/2010 10:10 AM, finestraco wrote:
> Should I change date format in control panel or my
> application ?
> Thanks for your replay
>
> finestraco
>
>> 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 setting is  the user's
>> choice for all programs and shouldn't be altered for one
>> specific application or expected to be any particular
>> value.
>>
>> Report Bugs to Sybase:
>> http://case-express.sybase.com/cx/welcome.do Product
>> Enhancement Requests:
>> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>>
>> On 12/28/2010 6:47 AM, finestraco wrote:
>>> 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
0
Jerry
12/28/2010 8:14:53 PM
Don't change Control Panel. Control Panel shows what format the user 
sees. Inline code must use the format expected by the database which is 
"yyyy-mm-dd".

On 12/28/2010 10:10 AM, finestraco wrote:
> Should I change date format in control panel or my
> application ?
> Thanks for your replay
>
> finestraco
>
>> 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 setting is  the user's
>> choice for all programs and shouldn't be altered for one
>> specific application or expected to be any particular
>> value.
>>
>> Report Bugs to Sybase:
>> http://case-express.sybase.com/cx/welcome.do Product
>> Enhancement Requests:
>> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>>
>> On 12/28/2010 6:47 AM, finestraco wrote:
>>> 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
0
Roland
12/28/2010 8:24:41 PM
IIRC, PB stores dates and times and datetimes in its own internal format 
(ticks since 1/1/1900?) and that gets converted to DBMS format when you 
update. And of course can be displayed with the format of your choice in 
a visual control.

Report Bugs to Sybase:  http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

On 12/28/2010 3:24 PM, Roland Smith [TeamSybase] wrote:
> Don't change Control Panel. Control Panel shows what format the user
> sees. Inline code must use the format expected by the database which is
> "yyyy-mm-dd".
>
> On 12/28/2010 10:10 AM, finestraco wrote:
>> Should I change date format in control panel or my
>> application ?
>> Thanks for your replay
>>
>> finestraco
>>
>>> 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 setting is the user's
>>> choice for all programs and shouldn't be altered for one
>>> specific application or expected to be any particular
>>> value.
>>>
>>> Report Bugs to Sybase:
>>> http://case-express.sybase.com/cx/welcome.do Product
>>> Enhancement Requests:
>>> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>>>
>>> On 12/28/2010 6:47 AM, finestraco wrote:
>>>> 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
0
Jerry
12/28/2010 8:45:42 PM
is that all dbms's?

On 28/12/10 3:24 PM, Roland Smith [TeamSybase] wrote:
> Don't change Control Panel. Control Panel shows what format the user
> sees. Inline code must use the format expected by the database which is
> "yyyy-mm-dd".
>
> On 12/28/2010 10:10 AM, finestraco wrote:
>> Should I change date format in control panel or my
>> application ?
>> Thanks for your replay
>>
>> finestraco
>>
>>> 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 setting is the user's
>>> choice for all programs and shouldn't be altered for one
>>> specific application or expected to be any particular
>>> value.
>>>
>>> Report Bugs to Sybase:
>>> http://case-express.sybase.com/cx/welcome.do Product
>>> Enhancement Requests:
>>> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>>>
>>> On 12/28/2010 6:47 AM, finestraco wrote:
>>>> 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

0
300ZX
12/30/2010 1:54:03 PM
Reply:

Similar Artilces:

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...

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...

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...

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...

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...

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...

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. Wh...

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...

Date being forced to 01/01/2000
On a date/time field, when a back space (or when a zero is keyed in) is used to correct either the day and/or month part of the field, PB forces the date to 01/01/2000. I would like it to be set to zeros instead. The datatype is datetime, format - [shortdate][time] with an editmask mm/dd/yyyy hh:mm I have several of these fields and so what is the best way to do this? ( PB Ver 7.0.2 Build 8011) thanks, madhu ...

Date/Time defaulting to 01/01/00
I am running an application using Powerbuilder 4.0. The user has to enter a birth date. There is an edit mask on the field(00/00/00 00:00). The field is a DATETIME field in the database. If there is not a birth date and the user types in 00/00/00 00:00, the birth date defaults to 01/01/00. How can I get the birth date field to be EITHER 00/00/00 00:00 OR NULL and stop it from defaulting to 01/01/00. Any help in this matter will be greatly appreciated. Thank You, P.J. Borandi pborandi@nb.net ...

01 01 1985
Name: kebe Email: alydotndiayeatrocketmaildotcom Product: Firefox Summary: 01 01 1985 Comments: i'm so happy Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Web resources about - date is 01/01/1900 - sybase.powerbuilder.general

List of members of the Swiss Federal Council by date - Wikipedia, the free encyclopedia
The Swiss Federal Council and the Federal Chancellor as of February 2008. From left to right: Eveline Widmer-Schlumpf , Moritz Leuenberger , ...

Motorists can access up-to-date service station data on fuel prices - The Courier-Mail Search Search
MOTORISTS will be able to access up-to-date information on local petrol prices next year.

New Apple iPhone rumors China Mobile leaks April release date
Computerworld New Apple iPhone rumors China Mobile leaks April release date Computerworld Apple will launch the iPhone 6c early next year, ...

China Mobile roadmap reveals iPhone 7c launch date
The biggest wireless carrier in the world may have just revealed when the iPhone 6c 7c will finally launch. Rumors of the iPhone 7c have been ...

Midseason Premiere & Return Dates: 2016 Edition
The second leg of the 2015-16 TV season is just around the corner. Here's a rundown of nearly 300 premiere dates for new series, new seasons ...

Courteney Cox and Will Arnett 'All Over Each Other' During Dinner Date, Source Says
Courteney Cox and Will Arnett 'All Over Each Other' During Dinner Date, Source Says

‘Outlander’ News: Sam Heughan Hints Season 2 Premiere Date Announced Soon?
... star Sam Heughan recently confirmed that filming for season two is almost done and hinted that STARZ could announced the premiere date very ...

Apple Loop: New iPhone Launch Date Leaks, Surface Pro Defeats iPad, Apple Abandons Headphone Jack
This week?s Apple Loop includes the leaked release date of the iPhone Mini, a review of the new MacBook, thoughts on Apple dropping the 3.5mm ...

Stars who date teens
Stars who date teens

Out of their league: Ugly guys who date bombshells - Slideshow - Fox News
How do these odd-looking guys attract such lovely ladies?

Resources last updated: 12/27/2015 12:29:19 AM