Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Better way to create blank numeric col in view
Message
 
 
To
29/05/2008 11:42:34
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01320265
Message ID:
01320266
Views:
18
This message has been marked as the solution to the initial question of the thread.
See CAST() function.
SELECT Quotes.*, CAST(0 AS N(3)) AS Years ;
...
>
>I have a need in a view to create a 3 digit wide blank numeric column that is filled in after the view is queried. The only way I could figure out how to do this is to insert an IIF() in as an expression to the view designer something like this (this is the resulting SQL SELECT):
>
>
>
>SELECT Quotes.*, IIF(.T.,000,000) AS Years ;
>   FROM Quotes...
>
>
>
>The problem is, the view designer wants to keep stripping out the extra zeros if you edit the view so that it becomes IIF(.T.,O,O) and I end up with a 1 digit wide column created...which causes numeric overflow. I don't want to have to switch to using a character column as that would be a lot of grief. Any better way to get a multi-digit column from within the view designer?
>
>Thx.
>Albert
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform