Michael,
You are dynamically setting the width of an sql select field, so VFP will
decide on the length of the field based upon the first field it comes across
(hence setting the length to 1) and then fill it in with the "123123..."etc
which will just get the first character.

You must pad out both options in the iif to the same length.

Dave Crozier
 The secret to staying young is to live honestly, eat slowly, and to lie
about your age 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Michael Hawksworth
Sent: 22 September 2006 14:38
To: Profox
Subject: Update and selects

Has anyone seen something like this..

If I run this code I get LineProductCode set to just '1'
Update curLoad_Product;
        Set LineProductCode =     (select ;
                                            
iif(curLoad_ProductCount.ProdCount>0,'12312312312313','') ;
                                        from ;
                                            curLoad_ProductCount ;
                                        where ;
                                            curLoad_Product.TradingDate =
curLoad_ProductCount.TradingDate and;
                                            curLoad_Product.Load =
curLoad_ProductCount.Load;
                                        ) however if I change the iif line
to read
iif(Vartype(curLoad_ProductCount.ProdCount) = 'N','12312312312313','') ; it
returns '12312312312313'.

Anyone any ideas why it is truncating the value?

--
Michael Hawksworth
Visual Fox Solutions

[EMAIL PROTECTED]
www.foxpro.co.uk





[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to