Results 1 to 5 of 5
  1. #1
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71

    Conditional Select Statement


    Hello again,
    I need to create a query/process that removes a certain population from an existing query to populate a new datasheet. For instance, if ResourceName does not contain "TBD ", those records are not needed. I dont think this can be completed with a simple IIf statement. Please correct me if I am wrong. Essentially, I only need records that contain TBD in ResourceName.



    SELECT [ResourceAllocation_2010-Query].ResourceManager, [ResourceAllocation_2010-Query].ResourceName, [ResourceAllocation_2010-Query].Project, [ResourceAllocation_2010-Query].January, [ResourceAllocation_2010-Query].JanuaryPercent, [ResourceAllocation_2010-Query].February, [ResourceAllocation_2010-Query].FebruaryPercent, [ResourceAllocation_2010-Query].March, [ResourceAllocation_2010-Query].MarchPercent, [ResourceAllocation_2010-Query].April, [ResourceAllocation_2010-Query].May, [ResourceAllocation_2010-Query].MayPercent, [ResourceAllocation_2010-Query].June, [ResourceAllocation_2010-Query].JunePercent, [ResourceAllocation_2010-Query].July, [ResourceAllocation_2010-Query].JulyPercent, [ResourceAllocation_2010-Query].August, [ResourceAllocation_2010-Query].AugustPercent, [ResourceAllocation_2010-Query].September, [ResourceAllocation_2010-Query].SeptemberPercent, [ResourceAllocation_2010-Query].October, [ResourceAllocation_2010-Query].November, [ResourceAllocation_2010-Query].NovemberPercent, [ResourceAllocation_2010-Query].December, [ResourceAllocation_2010-Query].DecemberPercent
    FROM [ResourceAllocation_2010-Query];

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Maybe I didnot get what you said.
    I think a where clause can do it.

  3. #3
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    you are right but I am having trouble with the WHERE clause. How would I write that if all I want is the record if the first 3 letters of ResourceName = TBD? This is what I tried but it certainly isnt working.

    WHERE ([ResourceAllocation_2010-Query].ResourceName,3)="TBD");

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    WHERE ([ResourceAllocation_2010-Query].ResourceName,3) like "TBD*");

  5. #5
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    WHERE ([ResourceAllocation_2010-Query].ResourceName) like "TBD*";

    Thanks Again!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. select statement
    By jellybeannn in forum Access
    Replies: 5
    Last Post: 08-13-2010, 05:21 AM
  2. Logic statement to select report
    By AKQTS in forum Reports
    Replies: 7
    Last Post: 07-30-2010, 12:52 PM
  3. Select statement syntax?
    By ksmith in forum Programming
    Replies: 3
    Last Post: 06-24-2010, 09:21 AM
  4. What is wrong with my SQL Select statement?
    By John2810 in forum Programming
    Replies: 2
    Last Post: 04-01-2010, 10:30 AM
  5. Help with Conditional statement in query
    By Rhues in forum Queries
    Replies: 1
    Last Post: 01-11-2010, 02:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums