Hello Hermione,
your query cannot call the method GetAbbrUM. You need to create the SQL
statement, send it to SQL Server or whatever database you are using, get
back the results (which will come back as one or more rows), then loop
through the results. In each result, you can extract the field and perform
the calculation.
All you are doing, in the statement below, is passing in the string
"[TYPE1]" to your function... which is probably not what you want.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Hermione" <He******@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
Hi
I<m wrting a SQL string in my VB .NET application.
There is a function in my string but it<n not seem working
I have always an syntax error message
this is my quesry
strSQL = "INSERT INTO Tb_client( IDclient, c1CommUOM )" _
& " SELECT Tb_Temp.COMPFILE, " & getAbbrUM( "[TYPE1]" ) & " AS
c1CommUOM FROM Tb_Temp"
Where Type1 is a string in the Table Tb_Temp
Any idea who can I use a function in a SQl Query in a VB .NEt code
Thanks