El Martes, 12 de Noviembre de 2002 08:43, [EMAIL PROTECTED] 
escribió:
> I'm using MS SQL Server 2000.
>
> It means that you don't insert the date with the form but your database
> insert it automatically!?

Yes. I mean create a default value for this. Then in the insert I omit to send 
a value for the date field and the database server make it for me.

I am sure that in MS SQL Server must be a similar instruction to do that. Lets 
check the command for CREATE TABLE (or something similar) and how to create a 
default value for a date field.

For example in PostgreSQL I write use:

CREATE TABLE CanjeEstado
  (
    can_id       int4            not null,
    tec_id       int4            not null default 1,
    usr_id       int4            not null,
    ces_tiempo   timestamp       not null default now(),

    primary key(can_id,tec_id),
    unique(can_id,tec_id),
);

As you can see, the ces_tiempo is of type TIMESTAMP can not be null and there 
is a default value for the field tha is defined using the built-in function 
"now()".

Check for something similar in your database I am sure there must be a similar 
approach.

Regards,

Antonio Gallardo

>
> Sylvain
>
> -----Message d'origine-----
> De: Antonio Gallardo Rivera [mailto:agallardo@;agsoftware.dnsalias.com]
> Date: mardi, 12. novembre 2002 15:14
> À: [EMAIL PROTECTED]
> Objet: Re: XMLForm and dates
>
>
> hat database are you using? I am using PostgreSQL 7.2.
>
> I resolve this problem setting the requiered field in the database with
> default value today.
>
> Antonio Gallardo
>
> El Martes, 12 de Noviembre de 2002 08:00, [EMAIL PROTECTED]
>
> escribió:
> > Hello,
> >
> > I use XMLForm and I want to put the today date in a form.
> > The problem is that the today date has to be a String because the XMLForm
> > simply display the value of the Bean class attribute. If this value is
> > not a String, the date can't be read! But I want to store the today date
> > in a Date format (because I have a timestamp format in my database).
> >
> > How to store the date in a Date type and display it like a String?
> > How to do this??
> >
> > Thank you
> > Sylvain
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> > For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to