i got this query where i require the value retrieve from group by to store as a variable.
My script:
sqlread ="SELECT Count(*) as NoOfRec ,([Customer_Name])"&_
" FROM [TheCat13]"&_
" WHERE [Customer_Number] = '"&_
""&CustomerNumber&"'"&_
"GROUP BY [Customer_Name]"
rs.Open sqlread, myConn
if NoOfRec = 1 then
'Exists
CustomerName = rs.fields("Customer_Name")
else
CustomerName ="Not Found"
end if
rs.Close
Please advise how do i store as variable.
Result to store in a variable