Results 1 to 6 of 6
  1. #1
    keatsy_040489 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Philippines
    Posts
    7

    QUERY Help!

    Hello, I am working with my database now and I am having trouble on creating a query that display/show records that I need with a certain criteria from different fields (let say 5 fields) and ignore all fields that have a specific value (e.g. [field1] = "OK"). Any Suggestions may be a great help. Thank you in advance. God bless



    The remarks field is where to display the values of Architectural Presentability, Structural Stability,... which are not equal to "OK"

    BusinessInfo (tablename)
    [Business ID] [Business Name] [Location] [Street] [Barangay] (fieldnames)

    Details (tablename)


    ID [Architectural Presentability] [Structural Stability]... (fieldnames)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't really understand your requirements. You want to exclude records where a field value = 'OK'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Rather crude way of doing things, but just check out if it gives some guidelines :

    Code:
    SELECT 
    	myTable.ID, 
    	myTable.Field1, 
    	myTable.Field2, 
    	myTable.Field3, 
    	myTable.Field4, 
    	myTable.Field5, 
    	myTable.Field6, 
    	[Field1] & "," & [Field2] & "," & [Field3] & "," & [Field4] & "," & [Field5] & "," & [Field6] & "," AS Field1To6, 
    	Replace([Field1To6],"ok,","") AS RemoveOK, 
    	Len([RemoveOK]) AS LengthOfString, 
    	IIf([LengthOfString]<>0,Left([RemoveOK],[LengthOfString]-1),"") AS WitoutEndTrailingComma
    FROM 
    	myTable;
    Thanks

  4. #4
    keatsy_040489 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Philippines
    Posts
    7
    Quote Originally Posted by June7 View Post
    Don't really understand your requirements. You want to exclude records where a field value = 'OK'?
    I want to display what i am needed dude. And this time I don't Need the "Ok" records. All I need is to create a summarized field (this time is a Remarks field) on a query..hehe. Thank you for the help.

  5. #5
    keatsy_040489 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Philippines
    Posts
    7
    Quote Originally Posted by recyan View Post
    Rather crude way of doing things, but just check out if it gives some guidelines :

    Code:
    SELECT 
    	myTable.ID, 
    	myTable.Field1, 
    	myTable.Field2, 
    	myTable.Field3, 
    	myTable.Field4, 
    	myTable.Field5, 
    	myTable.Field6, 
    	[Field1] & "," & [Field2] & "," & [Field3] & "," & [Field4] & "," & [Field5] & "," & [Field6] & "," AS Field1To6, 
    	Replace([Field1To6],"ok,","") AS RemoveOK, 
    	Len([RemoveOK]) AS LengthOfString, 
    	IIf([LengthOfString]<>0,Left([RemoveOK],[LengthOfString]-1),"") AS WitoutEndTrailingComma
    FROM 
    	myTable;
    Thanks
    You are my savior bro!. Thank you very much for the big help. Its better this way anyway I can modify my report design later for professional appealing look. I have been for countless sleepless nights solving this problem. Your're a god in this field. Thank you and More power! and continue supporting people like me.

  6. #6
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad you found it helpful.

    Thanks

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

Tags for this Thread

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