IIRC when VFP builds the result cursor, the SQL engine uses the values in the first row it finds to determine the data structure. This can result in truncated information.
Richard Kaye -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Vince Teachout Sent: Wednesday, April 01, 2009 3:08 PM To: [email protected] Subject: [NF] Unexpected SQL result - why? Taken from a problem that a colleague of mine is having. If we run the following query: select top 5 claimno, 0000000.00 as medical from dbo.payments order by claimno The resulting Medical field is numeric 4,2. e.g. 0.00 I can fix this by doing the following: select top 5 claimno, CAST(0000000.00 as numeric(7,2)) as medical from dbo.payments order by claimno But why do I get 0.00 in the first query? Just curious. (using vfp9, sp2, MSSQL 2005) _______________________________________________ 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 Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/df1eef11e586a64fb54a97f22a8bd044153e7...@ackbwddqh1.artfact.local ** 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.

