Access Equivalent.

A

AJ

Hi all, I have the following query which isn't quite finished!

1) How do i specify the '@Country' parameter is optional in an ACCESS stored
query? (like MSSQL @Country INT = NULL)

2) What is the Access Equivalent of the following AND CLAUSE ?
AND
c.Country = Coalesce(@Country, c.Country)

Query involved below:

SELECT DISTINCT
c.ID, c.Company_Name, p.[level], 1 As QueryNbr
FROM
(Company AS c LEFT JOIN Sale AS s ON c.ID = s.Company_ID)
LEFT JOIN
Package AS p
ON
s.Package_ID = p.ID
WHERE
c.Category = 'EXH'
AND
(s.ID = (SELECT Max(ID) FROM Sale WHERE Company_ID = c.ID) Or IsNull(s.ID)
AND
EXISTS(SELECT Company_ID FROM Event_Company_Link WHERE Event_ID =
@EventID AND Company_ID = c.ID)
AND
EXISTS(SELECT Company_ID FROM Company_Product_Link WHERE Product_ID =
@Products AND Company_ID = c.ID)
AND
(Start_Date <= Date()+1) AND (End_Date >= Date()+1)
AND
c.Country = /* Need Access equivalent of Coalesce(@Country, c.Country) */

Cheers,
Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top