[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



Hi Andrew,

Is it possible that it is actually the row after 1052 that is causing the
problem?  If the program were detecting an error in the show statement for 1052,
I would have thought that it would not have performed any part of that show
statement, and it is clearly doing the show.  I might be wrong, though.  Or it
could possibly be a statement after the show - I have found that the line
numbers in the error messages are not always 100% accurate.  I don't really
agree with the other responses you have gotten that the date is not null, as the
first select you are indicating only selects it if the date is null, so that
seems to me to prove that it is indeed null.

Denise White
Sr. Programmer/Analyst
Vicor
------------------------------

Date:    Thu, 24 Jan 2002 15:21:52 +0000
From:    Andrew Rivers <andrew.rivers@CWCOM.NET>
Subject: Odd Error:  Month must be between 1 and 12

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