Why - because -1 is a mathematical operation, it is outside of the oconv so it performs the maths on the output of the oconv operation, so 02 -1 = 1. To get the required format use a mask on the whole thing.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lettau, Jeff Sent: 08 February 2008 16:35 To: [email protected] Subject: [U2] OCONV DATE ISSUE. The question is when I do OCONV(@DATE, 'DM') I get 02 but when I do OCONV(@DATE, 'DM')-1 I get 1 not 01. Why? And how do I get these to match? The reason for this is I'm trying to do this as a i-desc But my dates don't equal because of the weird oconv issue. IF OCONV(@DATE, 'DM') - 1 < '1' THEN OCONV(@DATE, 'DY') - 1 : '12' ELSE OCONV(@DATE, 'DY') : OCONV(@DATE, 'DM') - 1; (OCONV(Inv_So_Date,'DY'):OCONV(Inv_So_Date,'DM')); IF B$Record_Type = 'BK' THEN IF @1 = @2 THEN QTY ELSE '0' ELSE '0' I'll take a better solution if someone has it since I have to do this for 36 months making 36 i-desc to put it in columns for my output that will need to be grouped and summed. Jeffrey Lettau ERP Systems Manager polkaudio ________________________________ Disclaimer: This email may contain confidential and/or privileged information. It is intended only for the person or persons to whom it is addressed. Any unauthorized review, use, or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email or telephone and destroy all copies of the original message. ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
