Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to do in view

Status
Not open for further replies.

leburg

Programmer
Feb 15, 2006
64
0
0
US
Can I convert line4 to a number within the view itself? It is string data to begin with.

REATE VIEW dbo.extradata_AC
AS
SELECT TOP 100 PERCENT number, line1, line2, line3, line4, line5
FROM dbo.extradata
WHERE (extracode = 'AC')
ORDER BY number

Thanks in advance.
 
use CAST(line4 AS INTEGER)

and best practice says you should not have an ORDER BY clause in your view at all

(this also removes the need for the silly "TOP 100 PERCENT")

r937.com | rudy.ca
 
Thanks, Rudy.

Hmmm, I still a bit green, if I don't order that field, and I use it as the field I link to in Crystal, does that make a difference then?

 
Thanks again, r937! I'll take advantage of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top