[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
- Subject: Re: Odd Error: Month must be between 1 and 12
- From: Sam Spritzer <sspritzer@GW.CTG.COM>
- Date: Fri, 25 Jan 2002 07:58:53 -0500
Andrew,
Sometimes I have problems with isnull or isblank so I would suggest trying
&invoicedate = '' or even ' '.
Sam
>>> andrew.rivers@CWCOM.NET 01/25/02 05:14 AM >>>
David
Initially, I was using the condition:
( isnull(&invoicedate) or isblank(&invoicedate) )
Because I was getting the error I simplified the condition to:
( isnull(&invoicedate) )
I suspect that isblank() may not resolve the requirement.
I will try it and let you know.
Andrew
___________________________________
Quoting D E <wirebird1@HOTMAIL.COM>:
> 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 invoienum = '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.
>