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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with SQL statement

Status
Not open for further replies.

Ngabay

MIS
May 16, 2003
25
US
this expression works in access but not in the dataenviroment command in visual studio.

SELECT Client.ClientName, Client.Region, Client.Status, Client.Prob,
First(Next_Step.NextStep) AS FirstOfNextStep,
MAX(Activity. DATE) AS `Date`, First(Activity.Description)
AS Description
FROM ReportUW, (Client INNER JOIN
Activity ON Client.ClientID = Activity.ClientID) INNER JOIN
Next_Step ON Client.ClientID = Next_Step.clientID
GROUP BY Client.ClientName, Client.Region, Client.Status,
Client.Prob, Client.UWLname
HAVING (((Client.UWLname) = DFirst(" UWLame ",
" `ReportUW` ")))
ORDER BY Client.ClientName, MAX(Activity. DATE) DESC,
MAX(Next_Step. DATE) DESC;


but when I put it in a dataenviroment SQL command it gives me an error saying that the Dfirst command is unidentified.
My VB project is connected to an access database. Please help me solve this problem.

Thanks,
Nir



 
DFirst is an Access function rather than a VB function. You need to reference the Microsoft Access X.0 Object Library in your project. (Project|References| etc)

This means that you need to have Access on any machines that the program will run on, so there may be a license issue.


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Try using a Sub query:

HAVING Client.UWLname = (SELECT .... WHERE ....)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top