Results 1 to 4 of 4

Thread: Query help

  1. #1
    Join Date
    Sep 2008
    Posts
    101

    Unanswered: Query help

    Hi, I've been trying to build a query that is related to a form with combo boxes, im having trouble with one part of it where i need it to return different results from combo18 based on the value the user selects....
    if the combo18 is blank it returns all records, if combo18 is "Yes" it returns all records, if combo18 is no then it only returns "No" records

    im having trouble fitting this is with the rest of my query,
    any help appreciated
    thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Please post the SQL statement of the query as it is now.
    Have a nice day!

  3. #3
    Join Date
    Sep 2008
    Posts
    101
    SELECT Data.Channel, Data.Howcanwehelp, Data.MortgageType, Data.ProductType, Data.Loyalty, Data.CashbackFreelegals, Data.LTVMax, Data.Rate, Data.PRD_PCK_GRP_SCH_L
    FROM Data
    WHERE (((Data.Channel)=[Forms]![Form1].[Combo0]) AND ((Data.Howcanwehelp)=[Forms]![Form1].[Combo6]) AND ((Data.MortgageType)=[Forms]![Form1].[Combo12]) AND ((Data.ProductType)=[Forms]![Form1].[Combo16]) AND ((Data.Loyalty)=[Forms]![Form1].[Combo18]) AND ((Data.CashbackFreelegals)=[Forms]![Form1].[Combo22]) AND ((Data.LTVMax)>=[Forms]![Form1].[Text35])) OR (((Data.Channel)=[Forms]![Form1].[Combo0]) AND ((Data.Howcanwehelp)=[Forms]![Form1].[Combo6]) AND ((Data.MortgageType)=[Forms]![Form1].[Combo12]) AND ((Data.ProductType)=[Forms]![Form1].[Combo16]) AND ((Data.LTVMax)>=[Forms]![Form1].[Text35]) AND (([Forms]![Form1].[Combo18]) Is Null) AND (([Forms]![Form1].[Combo22]) Is Null) AND ((([Data].[Loyalty]) Like [Forms]![Form1].[Combo18]) Is Null) AND ((([Data].[LTVMax]) Like [Forms]![Form1].[Text35]) Is Null)) OR (((Data.Channel)=[Forms]![Form1].[Combo0]) AND ((Data.Howcanwehelp)=[Forms]![Form1].[Combo6]) AND ((Data.MortgageType)=[Forms]![Form1].[Combo12]) AND ((Data.ProductType)=[Forms]![Form1].[Combo16]) AND ((Data.Loyalty)=[Forms]![Form1].[Combo18]) AND ((Data.LTVMax)>=[Forms]![Form1].[Text35]) AND ((([Data].[CashbackFreelegals]) Like [Forms]![Form1].[Combo22]) Is Null)) OR (((Data.Channel)=[Forms]![Form1].[Combo0]) AND ((Data.Howcanwehelp)=[Forms]![Form1].[Combo6]) AND ((Data.MortgageType)=[Forms]![Form1].[Combo12]) AND ((Data.ProductType)=[Forms]![Form1].[Combo16]) AND ((Data.LTVMax)>=[Forms]![Form1].[Text35]) AND ((([Data].[Loyalty]) Like [Forms]![Form1].[Combo18]) Is Null) AND ((([Data].[CashbackFreelegals]) Like [Forms]![Form1].[Combo22]) Is Null))
    ORDER BY Data.PRD_PCK_GRP_SCH_L;

  4. #4
    Join Date
    Sep 2008
    Posts
    101
    Its a bit messy and didnt start off like that but ive been adding things to it and it works apart from what i need above.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •