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 expression

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, not a function of Jet. Therefore, you will not be able to use Dfirst in your data environment command.

What exactly are you trying to accomplish by using the DFirst?
 
I have a table with many activities and dates that are linked to a client table. I want a report that displays only the latest date and ctivity per client.

When a user runs the report, he should be able to select a name of an underwriter. The name will automatically be placed in a table called ReportUW. What I am doing is comparing Client.Lname to ReportUW.Lame. It should only display the names under that condition.

thanks,
Nir
 
This appears to be a duplicate post to one in the Database forum. Please read faq222-2244 to find out why this is not a good idea!


________________________________________________________________
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.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top