William: That would seem to make the most sense and will work most of the time but based on past discussions with the list, it is recommended that date columns be compared to text variables that look like dates. For whatever reason that is a more reliable approach than just using date variables. Perhaps someone on the list or at RBTI can provide a good explanation of why it works better that way.
I can say from personal experience that the reliability and stability of my programs has improved since using the "text variable that looks like a date" approach. Thanks -- Mike -----Original Message----- From: William Cook [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 11:33 AM To: [email protected] Subject: [RBASE-L] - RE: Invalid date value error Surely you want to compare dispdate (a date) with other date values. vmintext and vmaxtext are text values. Try vmindate and vmaxdate instead. WHERE dispdate BETWEEN > .vmintext AND .vmaxtext (where dispdate is a date ----- Original Message ----- From: "Ramsour Mike" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[email protected]> Sent: Tuesday, September 20, 2005 08:24 Subject: [RBASE-L] - RE: Invalid date value error > Javier: > > The place in my code where I get the error is when I use the variable > reference in a SELECT statement. > > For example: > > SET VAR vmaxdate DATE = ( .#date - 1) > -- > SET VAR vmindate DATE = ( .vmaxdate - 7 ) > -- > SET VAR vmaxtext TEXT = .vmaxdate > -- > SET VAR vmintext TEXT = .vmindate > -- > SELECT dispdate, dfct_code, pounds FROM rej_view WHERE dispdate BETWEEN > .vmintext AND .vmaxtext (where dispdate is a date column) > > It's something to do with how R:Base is interpreting the variables at a > particular moment in time. The same variables will be interpreted > correctly > at one point in a program and will err out in another part of my program. > > I am going to go through my programs and use your suggestion about using > the > CTXT function. I'll see if that helps. > > Thanks -- Mike > > -----Original Message----- > From: Javier Valencia [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 20, 2005 10:51 AM > To: [email protected] > Subject: [RBASE-L] - RE: Invalid date value error > > > Mike: > I believe that your code should work correctly; however, I prefer the > following command to convert a DATE value to TEXT: > SET VAR vmintext TEXT = (CTXT(.vmindate)) > I am not sure where in your code you get the error. I would think that it > would be if you try to compare/equate variables of different type. You > might > try TRACEing your code to determine where you get the error and then make > sure that your variables are properly defined and your expressions have > variables of like type. > Javier, > > Javier Valencia, PE > President > Valencia Technology Group, L.L.C. > 14315 S. Twilight Ln, Suite #14 > Olathe, Kansas 66062-4578 > Office (913)829-0888 > Fax (913)649-2904 > Cell (913)915-3137 > ================================================ > Attention: > The information contained in this message and or attachments is intended > only for the person or entity to which it is addressed and may contain > confidential and/or privileged material. Any review, retransmission, > dissemination or other use of, or taking of any action in reliance upon, > this information by persons or entities other than the intended recipient > is prohibited. If you received this in error, please contact the sender > and > delete the material from all system and destroy all copies. > ====================================================== > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Ramsour > Mike > Sent: Tuesday, September 20, 2005 9:11 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - Invalid date value error > > Good morning: > > I frequently get an "Invalid date value" error in my programs. Based on > advice from the list, I typically create a date variable and then assign > the > value to a text variable. > > For example: > > SET VAR vmindate DATE = ( .#date - 1) > -- > SET VAR vmintext TEXT = .vmindate > > I then use the text equivalent of the variable in my program using > <column> > = .vmintext. > > What is perplexing is that I can run a program and get the error message > and > then IMMEDIATELY rerun the program and it will run fine with no errors. I > have confirmed the value of the variables using the SHOW VAR command. My > database gets RELOADed daily and I run R:SCOPE against to verify the > database integrity. > > Why is this happening? Is there a better way to deal with date values? > > I am using R:Base 6.5++ (sorry, my company hasn't given me the money yet > to > upgrade to 7.1 -- drat!) > > Please help before I go completely crazy! > > Thanks > > Mike Ramsour > c/o AK Steel > > Voice 740-829-4340 > > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.344 / Virus Database: 267.11.3/106 - Release Date: 9/19/2005 >

