Normal Topic @ToDate  Question (Read 1975 times)
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
@ToDate  Question
Jan 9th, 2004 at 6:21pm
Print Post Print Post  
Greetings Lanticians, members

I created text box called "Input" in a form

Program Editor

Input =@ToDate(Input)   on Form Entry

I get no errors. but when I test adding data in preview

the text field reads 0000/00/00

Q- How come the date does not show up?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ToDate  Question
Reply #1 - Jan 9th, 2004 at 7:04pm
Print Post Print Post  
What value does Input have On Form Entry on a new record? I would think it would be blank unless it is being set earlier in the programming for this event.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @ToDate  Question
Reply #2 - Jan 9th, 2004 at 7:06pm
Print Post Print Post  
Quote:
I created text box called "Input" in a form

Program Editor

Input =@ToDate(Input)   on Form Entry

I get no errors. but when I test adding data in preview

the text field reads 0000/00/00

Q- How come the date does not show up?


@todate  function is to convert the other value to date value.  What you want is the date displayed on phone entry.  In Q& A there used to be Initial value in which you could put @date in order to take today's date value in the date field but you cannot use @date in Sesame.

What you want to do is to have the Input data formatted for Date instead text value.  Obviously it is formatted as text in order to display the format yyyy/mm/dd, that is the way it is stored in the database.

In Program Editor

Input =@Date   on Form Entry

I think, this should do it what you want.  I am just amateur and If I am not clear or wrong, a Lantican Member will give guidance.

Bharat
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @ToDate  Question
Reply #3 - Jan 9th, 2004 at 7:12pm
Print Post Print Post  
Quote:
What you want is the date displayed on phone entry.


What I meant was Form Entry. Sorry.
  
Back to top
 
IP Logged
 
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Re: @ToDate  Question
Reply #4 - Jan 9th, 2004 at 7:21pm
Print Post Print Post  
I orginally set up Input as a text box unbound.  Then I  tried to program it  as follows:

Input =@ToDate(Input)

My goal is thatf once a record is added. It stamps a date.

I can try to save this text box as a bound to New date and see what happens.

Thanks,  still working on this.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @ToDate  Question
Reply #5 - Jan 9th, 2004 at 7:35pm
Print Post Print Post  
Dave,

1. An unbound element does not save values to the database, so, your datestamp would disappear as soon as you left the record.

2. @ToDate(Input) will convert the value currently in Input to a date. If Input is empty, the result is 0000-00-00. Try this:
Input = @Date
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @ToDate  Question
Reply #6 - Jan 9th, 2004 at 7:36pm
Print Post Print Post  
Dave,

I use this to accomplish the task you explained. It only executes if the record is totally new. My Element is called Dateentered and this is the code snippet that executes on form entry.

// This enters Todays Date if record is new

If @isnew and Dateentered = "" then

    dateentered = @date

}
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
dcostanzo
Junior Member
Members
**
Offline


No personal text

Posts: 58
Joined: Mar 13th, 2003
Re: @ToDate  Question
Reply #7 - Jan 9th, 2004 at 7:53pm
Print Post Print Post  
I would like to Thank everyone for their response.

Smiley Smiley SmileyI have working.   Smiley Smiley Smiley

Input = @Date on element entry

I knew I was close.

Thanks Again.

Regards,

Dave Costanzo
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @ToDate  Question
Reply #8 - Jan 9th, 2004 at 8:05pm
Print Post Print Post  
Quote:
Input = @Date on element entry


Dave,

Just a word of caution.

You said on element entry. This means every time you click into the  element input the date will change to that days date.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @ToDate  Question
Reply #9 - Jan 9th, 2004 at 8:06pm
Print Post Print Post  
Quote:
I would like to Thank everyone for their response.

   I have working.      

Input = @Date on element entry



As Bob Scott suggested, it is important to also add

If @add  and Input =""  then {Input = @date}

( you can also use @isnew ), else every time you go in update, it will change the date to today's date, and I do not think you want to have that.

  
Back to top
 
IP Logged