Normal Topic Default Date? (Read 612 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Default Date?
Jan 23rd, 2006 at 4:56am
Print Post Print Post  
I have the following code to add one year to a Date element:
Code
Select All
MembershipEnd = MembershipStart + 365.25 

But if the Start date is blank the End date calculates to 12/31/2001.  Is there some type of default date for a blank?

I have already modified the code to only execute if Start date is not blank, but I am curious about why 12/31/2001 comes up if Start is blank.

Will 12/31/2000 always be a basis if a blank Date element is referenced in formula?  So, if we see 12/31/2000, where we ecpect to see something else, can we use that as an indication that the referenced date element must be blank?

It is not always easy to use a Date conditionally.  Suppose we are builiding strings or formulas calling multiple dates, must we write conditional traps for each Date called? 

I think that some type of null value would be better than a predefined date.  At least a null might provide an ERROR in a calculation, whereas a date will provide a valid calculation process, but an invalid result, with no indication of the problem.

Just trying for a better understanding of what is under the covers to have a better idea of what to expect with certain conditions.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Default Date?
Reply #1 - Jan 23rd, 2006 at 3:12pm
Print Post Print Post  
Hello Bob,

Are you sure you are seeing 12/31/2001 and not 12/31/0001? If you are only seeing 12/31/01 you need to change your date format to display a four digit year.

The default date value is nothing or formatted as a date it is 00/00/0000.

If you add 365.25 to 0 and format it as a date you will get 12/31/0001 which would be the date if you went 365 days from 00/00/0000.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Default Date?
Reply #2 - Jan 23rd, 2006 at 5:03pm
Print Post Print Post  
No access right now, but you may be right....too many hours in front of the screen..... Grin

But even if that is correct, default = 0, I would still prefer to have a NULL that could bring back some type of error notification vs. allowing calculations and strings to be processed.

Thanks for listening.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Default Date?
Reply #3 - Jan 24th, 2006 at 3:03pm
Print Post Print Post  
Quote:
But even if that is correct, default = 0, I would still prefer to have a NULL that could bring back some type of error notification vs. allowing calculations and strings to be processed.

Thanks for listening.


There is no such thing as a NULL Date. In Sesame a Date is a Date and not a string. NULL is used in strings. So Dates can not be NULL, neither can Time or Numbers.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged