Access Equivalent.

Discussion in 'ASP General' started by AJ, Jul 19, 2006.

  1. AJ

    AJ Guest

    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
    AJ, Jul 19, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Duffy

    Re: Image Scanning - TWAIN equivalent

    Brendan Duffy, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,482
    Brendan Duffy
    Jul 24, 2003
  2. Lolo
    Replies:
    3
    Views:
    594
  3. Sanjeev
    Replies:
    4
    Views:
    3,566
    Jonathan Bromley
    Jul 23, 2004
  4. flupke
    Replies:
    2
    Views:
    294
    jean-michel
    Feb 11, 2005
  5. Nathan Weston
    Replies:
    0
    Views:
    107
    Nathan Weston
    Sep 5, 2003
Loading...

Share This Page