[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Odd Error: Month must be between 1 and 12



You can use isblank function instead of isnull. Hope
it helps.

--- D E <wirebird1@HOTMAIL.COM> wrote:
> Andrew,
>
> I would think that invoicedate isn't null.  The
> field must contain a space
> or similar character.  Perhaps you could use
> length() to determine your if
> statement:
>
> If length(&invoicedate) < 2 (or 3 or 4 whatever is
> appropriate)
>           show 'invoicenum: ' &invoicenum ' is NULL'
>        else
>           show 'invoicenum: ' &invoicenum ' -
> Invoicedate: '
> End-If
>
> David
>
>
> >From: Andrew Rivers <andrew.rivers@CWCOM.NET>
> >Reply-To: sqr-users@list.iex.net
> >To: SQR-USERS@list.iex.net
> >Subject: Odd Error:  Month must be between 1 and 12
> >Date: Thu, 24 Jan 2002 15:21:52 +0000
> >
> >Hi
> >I get the error:
> >Error on line 1377:
> >    (SQR 1925) Month must be between 1 and 12.
> >
> >Line 1377 is as follows (all on one line):
> >     show 'invoicenum: ' &invoicenum ' -
> Invoicedate: '  &invoiceDate
> >
> >The problem is a NULL value for &invoiceDate in the
> database.
> >      select invoicenum, invoicedate from invoice
> >             where invoicenum = '1052' and
> invoicedate is null;
> >This returns:
> >      INVOICENUM     INVOICEDATE
> >      ========== ====================
> >      1052
> >
> >      1 ROW SELECTED
> >showing that invoicenum = '1052' is NULL.
> >
> >However, if the following code is run:
> >       if  isnull( &invoiceDate )
> >          show 'invoicenum: ' &invoicenum ' is
> NULL'
> >       else
> >          show 'invoicenum: ' &invoicenum ' -
> Invoicedate: '  &invoiceDate
> >       end-if
> >
> >the else statement is executed for invoicenum =
> '1052' and the program
> >terminates at:
> >       invoicenum: 1052 - Invoicedate:
> >
> >Other fields including date fields do not give
> problems.
> >
> >If anyone has any suggestion as to the problem, I
> would be most grateful.
> >
> >Andrew
>
>
>
>
>
_________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com