Subject Re: [firebird-support] Noobie Null Date and Time woes
Author Lin XG
Hi Jason;

myDate is a string.

Thanks for the tip, but it doesn't work.

If I use 12/13/05 10:00 the query will look like

INSERT INTO MYTABLE (MYDATE) VALUES ('12/13/05
10:00');

If I use "NULL" the query comes out looking like

INSERT INTO MYTABLE (MYDATE) VALUES ('NULL');

which generates a string conversion error.

Still scratching my head.

Lin

--- Jason Dodson <jasond@...> wrote:

> Is MyDate a Variant?
>
> Anyway, set MyDate = "NULL", quotes and all. The SQL
> will work fine as long as
> MyDate holds the STRING "NULL", not a NULL value.
>
> Jason
>
> sbdlinxg wrote:
> > I've just discovered Firebird and I'm using VB to
> experiment with it.
> > This code works fine
> >
> > myDate = Format(Now(), "mm/dd/yy hh:mm")
> > sql = "INSERT INTO MYTABLE (MYDATE) VALUES ('" &
> myDate & "');"
> >
> > as long as myDate is a date. If I set myDate =
> NULL the statement
> > causes an error and I know why the error is
> occurring.
> >
> > What I need to know is how to write this statement
> to take into
> > account the possibility that myDate is NULL.
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Visit http://firebird.sourceforge.net and click
> the Resources item
> > on the main (top) menu. Try Knowledgebase and FAQ
> links !
> >
> > Also search the knowledgebases at
> http://www.ibphoenix.com
> >
> >
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
>
> The information transmitted herewith is sensitive
> information intended only for use to the individual
> or entity to which it is addressed. If the reader
> of this message is not the intended recipient, you
> are hereby notified that any review, retransmission,
> dissemination, distribution, copying or other use
> of, or taking of any action in reliance upon, this
> information is strictly prohibited. If you have
> received this communication in error, please contact
> the sender and delete the material from your
> computer.
>


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com