Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Query Question!

Discussion in 'Information Technology' started by Bob, Jul 28, 2006.

Tags:
  1. Bob

    Bob
    Expand Collapse
    Guest

    Can I make a query not show that line if the 2nd column is empty. The query
    has 3 columns but don't want to show it if the 2nd column is empty


    Thanks in advance.........Bob Vance
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Ken Snell \(MVP\)

    Ken Snell \(MVP\)
    Expand Collapse
    Guest

    Something like this?

    SELECT * FROM TableName
    WHERE TableName.NameOfField2 Is Not Null;

    --

    Ken Snell
    <MS ACCESS MVP>

    "Bob" <xxx@xx.xx> wrote in message news:e81tc2$a0g$1@lust.ihug.co.nz...
    >
    >
    > Can I make a query not show that line if the 2nd column is empty. The
    > query has 3 columns but don't want to show it if the 2nd column is empty
    >
    >
    > Thanks in advance.........Bob Vance
    >
     
  4. Bob

    Bob
    Expand Collapse
    Guest

    Ken where do I put this script? Thanx Bob

    "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    news:eCI16e%23mGHA.4144@TK2MSFTNGP05.phx.gbl...
    > Something like this?
    >
    > SELECT * FROM TableName
    > WHERE TableName.NameOfField2 Is Not Null;
    >
    > --
    >
    > Ken Snell
    > <MS ACCESS MVP>
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e81tc2$a0g$1@lust.ihug.co.nz...
    >>
    >>
    >> Can I make a query not show that line if the 2nd column is empty. The
    >> query has 3 columns but don't want to show it if the 2nd column is empty
    >>
    >>
    >> Thanks in advance.........Bob Vance
    >>

    >
    >
     
  5. Larry Linson

    Larry Linson
    Expand Collapse
    Guest

    "Bob" <xxx@xx.xx> wrote

    > Ken where do I put this script? Thanx Bob


    That is the Query. You can paste it into the SQL Window of a Query, if you
    wish, in the Query Builder. Be sure to use the exact names you've used in
    defining the Fields in your Tables.

    Larry Linson
    Microsoft Access MVP
     
  6. Bob

    Bob
    Expand Collapse
    Guest

    Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE tblHorseOwnerPercentage.HorseName Is Not Null;

    "Larry Linson" <bouncer@localhost.not> wrote in message
    news:O0SM79%23mGHA.4144@TK2MSFTNGP05.phx.gbl...
    > "Bob" <xxx@xx.xx> wrote
    >
    > > Ken where do I put this script? Thanx Bob

    >
    > That is the Query. You can paste it into the SQL Window of a Query, if you
    > wish, in the Query Builder. Be sure to use the exact names you've used in
    > defining the Fields in your Tables.
    >
    > Larry Linson
    > Microsoft Access MVP
    >
    >
     
  7. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE tblHorseOwnerPercentage.HorseName Is Not Null
    ORDER BY OwnerName

    or

    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE tblHorseOwnerPercentage.HorseName Is Not Null
    ORDER BY 1


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    > Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    > SELECT *
    > FROM tblHorseOwnerPercentage
    > WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >
    > "Larry Linson" <bouncer@localhost.not> wrote in message
    > news:O0SM79%23mGHA.4144@TK2MSFTNGP05.phx.gbl...
    >> "Bob" <xxx@xx.xx> wrote
    >>
    >> > Ken where do I put this script? Thanx Bob

    >>
    >> That is the Query. You can paste it into the SQL Window of a Query, if
    >> you wish, in the Query Builder. Be sure to use the exact names you've
    >> used in defining the Fields in your Tables.
    >>
    >> Larry Linson
    >> Microsoft Access MVP
    >>
    >>

    >
    >
     
  8. Bob

    Bob
    Expand Collapse
    Guest

    Oops, what is wrong with this added Unique Values to yes
    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));

    "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    > Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    > SELECT *
    > FROM tblHorseOwnerPercentage
    > WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >
    > "Larry Linson" <bouncer@localhost.not> wrote in message
    > news:O0SM79%23mGHA.4144@TK2MSFTNGP05.phx.gbl...
    >> "Bob" <xxx@xx.xx> wrote
    >>
    >> > Ken where do I put this script? Thanx Bob

    >>
    >> That is the Query. You can paste it into the SQL Window of a Query, if
    >> you wish, in the Query Builder. Be sure to use the exact names you've
    >> used in defining the Fields in your Tables.
    >>
    >> Larry Linson
    >> Microsoft Access MVP
    >>
    >>

    >
    >
     
  9. Bob

    Bob
    Expand Collapse
    Guest

    HorseName is still showing in drop down box when it is empty....Thanx Bob
    "Bob" <xxx@xx.xx> wrote in message news:e84cte$pdv$1@lust.ihug.co.nz...
    > Oops, what is wrong with this added Unique Values to yes
    > SELECT *
    > FROM tblHorseOwnerPercentage
    > WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    > WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    >> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    >> SELECT *
    >> FROM tblHorseOwnerPercentage
    >> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>
    >> "Larry Linson" <bouncer@localhost.not> wrote in message
    >> news:O0SM79%23mGHA.4144@TK2MSFTNGP05.phx.gbl...
    >>> "Bob" <xxx@xx.xx> wrote
    >>>
    >>> > Ken where do I put this script? Thanx Bob
    >>>
    >>> That is the Query. You can paste it into the SQL Window of a Query, if
    >>> you wish, in the Query Builder. Be sure to use the exact names you've
    >>> used in defining the Fields in your Tables.
    >>>
    >>> Larry Linson
    >>> Microsoft Access MVP
    >>>
    >>>

    >>
    >>

    >
    >
     
  10. Ken Snell \(MVP\)

    Ken Snell \(MVP\)
    Expand Collapse
    Guest

    Try this (catches both Null and empty string values):

    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
    ORDER BY OwnerName;

    --

    Ken Snell
    <MS ACCESS MVP>


    "Bob" <xxx@xx.xx> wrote in message news:e84d3o$q0e$1@lust.ihug.co.nz...
    > HorseName is still showing in drop down box when it is empty....Thanx Bob
    > "Bob" <xxx@xx.xx> wrote in message news:e84cte$pdv$1@lust.ihug.co.nz...
    >> Oops, what is wrong with this added Unique Values to yes
    >> SELECT *
    >> FROM tblHorseOwnerPercentage
    >> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >> WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    >>> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    >>> SELECT *
    >>> FROM tblHorseOwnerPercentage
    >>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>
     
  11. Bob

    Bob
    Expand Collapse
    Guest

    Brilliant :) Thanks....Bob

    "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    news:%232oHi9KnGHA.5056@TK2MSFTNGP04.phx.gbl...
    > Try this (catches both Null and empty string values):
    >
    > SELECT *
    > FROM tblHorseOwnerPercentage
    > WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
    > ORDER BY OwnerName;
    >
    > --
    >
    > Ken Snell
    > <MS ACCESS MVP>
    >
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e84d3o$q0e$1@lust.ihug.co.nz...
    >> HorseName is still showing in drop down box when it is empty....Thanx Bob
    >> "Bob" <xxx@xx.xx> wrote in message news:e84cte$pdv$1@lust.ihug.co.nz...
    >>> Oops, what is wrong with this added Unique Values to yes
    >>> SELECT *
    >>> FROM tblHorseOwnerPercentage
    >>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>> WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >>>
    >>> "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    >>>> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
    >>>> SELECT *
    >>>> FROM tblHorseOwnerPercentage
    >>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>

    >
    >
     
  12. Ken Snell \(MVP\)

    Ken Snell \(MVP\)
    Expand Collapse
    Guest

    Typo, I see:

    SELECT *
    FROM tblHorseOwnerPercentage
    WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0
    ORDER BY OwnerName;

    But, I assume you corrected the typo because you made it work! ;-)

    --

    Ken Snell
    <MS ACCESS MVP>


    "Bob" <xxx@xx.xx> wrote in message news:e84kaj$6vc$1@lust.ihug.co.nz...
    > Brilliant :) Thanks....Bob
    >
    > "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    > news:%232oHi9KnGHA.5056@TK2MSFTNGP04.phx.gbl...
    >> Try this (catches both Null and empty string values):
    >>
    >> SELECT *
    >> FROM tblHorseOwnerPercentage
    >> WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
    >> ORDER BY OwnerName;
    >>
    >> --
    >>
    >> Ken Snell
    >> <MS ACCESS MVP>
    >>
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e84d3o$q0e$1@lust.ihug.co.nz...
    >>> HorseName is still showing in drop down box when it is empty....Thanx
    >>> Bob
    >>> "Bob" <xxx@xx.xx> wrote in message news:e84cte$pdv$1@lust.ihug.co.nz...
    >>>> Oops, what is wrong with this added Unique Values to yes
    >>>> SELECT *
    >>>> FROM tblHorseOwnerPercentage
    >>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>> WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >>>>
    >>>> "Bob" <xxx@xx.xx> wrote in message news:e84cfo$oue$1@lust.ihug.co.nz...
    >>>>> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName)
    >>>>> Thanx..Bob
    >>>>> SELECT *
    >>>>> FROM tblHorseOwnerPercentage
    >>>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>>

    >>
    >>

    >
    >
     
  13. Bob

    Bob
    Expand Collapse
    Guest

    Yes thought 01 was a bit strange ;)

    "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    news:Ov$DwgLnGHA.2264@TK2MSFTNGP04.phx.gbl...
    > Typo, I see:
    >
    > SELECT *
    > FROM tblHorseOwnerPercentage
    > WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0
    > ORDER BY OwnerName;
    >
    > But, I assume you corrected the typo because you made it work! ;-)
    >
    > --
    >
    > Ken Snell
    > <MS ACCESS MVP>
    >
    >
    > "Bob" <xxx@xx.xx> wrote in message news:e84kaj$6vc$1@lust.ihug.co.nz...
    >> Brilliant :) Thanks....Bob
    >>
    >> "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    >> news:%232oHi9KnGHA.5056@TK2MSFTNGP04.phx.gbl...
    >>> Try this (catches both Null and empty string values):
    >>>
    >>> SELECT *
    >>> FROM tblHorseOwnerPercentage
    >>> WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
    >>> ORDER BY OwnerName;
    >>>
    >>> --
    >>>
    >>> Ken Snell
    >>> <MS ACCESS MVP>
    >>>
    >>>
    >>> "Bob" <xxx@xx.xx> wrote in message news:e84d3o$q0e$1@lust.ihug.co.nz...
    >>>> HorseName is still showing in drop down box when it is empty....Thanx
    >>>> Bob
    >>>> "Bob" <xxx@xx.xx> wrote in message news:e84cte$pdv$1@lust.ihug.co.nz...
    >>>>> Oops, what is wrong with this added Unique Values to yes
    >>>>> SELECT *
    >>>>> FROM tblHorseOwnerPercentage
    >>>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>> WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >>>>>
    >>>>> "Bob" <xxx@xx.xx> wrote in message
    >>>>> news:e84cfo$oue$1@lust.ihug.co.nz...
    >>>>>> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName)
    >>>>>> Thanx..Bob
    >>>>>> SELECT *
    >>>>>> FROM tblHorseOwnerPercentage
    >>>>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
  14. Bob

    Bob
    Expand Collapse
    Guest

    Ken what do I use for conditional Format to make a cell red when it is
    (Blank Empty) thanx bob
    "Bob" <xxx@xx.xx> wrote in message news:e84nm6$d9g$1@lust.ihug.co.nz...
    > Yes thought 01 was a bit strange ;)
    >
    > "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    > news:Ov$DwgLnGHA.2264@TK2MSFTNGP04.phx.gbl...
    >> Typo, I see:
    >>
    >> SELECT *
    >> FROM tblHorseOwnerPercentage
    >> WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0
    >> ORDER BY OwnerName;
    >>
    >> But, I assume you corrected the typo because you made it work! ;-)
    >>
    >> --
    >>
    >> Ken Snell
    >> <MS ACCESS MVP>
    >>
    >>
    >> "Bob" <xxx@xx.xx> wrote in message news:e84kaj$6vc$1@lust.ihug.co.nz...
    >>> Brilliant :) Thanks....Bob
    >>>
    >>> "Ken Snell (MVP)" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
    >>> news:%232oHi9KnGHA.5056@TK2MSFTNGP04.phx.gbl...
    >>>> Try this (catches both Null and empty string values):
    >>>>
    >>>> SELECT *
    >>>> FROM tblHorseOwnerPercentage
    >>>> WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
    >>>> ORDER BY OwnerName;
    >>>>
    >>>> --
    >>>>
    >>>> Ken Snell
    >>>> <MS ACCESS MVP>
    >>>>
    >>>>
    >>>> "Bob" <xxx@xx.xx> wrote in message news:e84d3o$q0e$1@lust.ihug.co.nz...
    >>>>> HorseName is still showing in drop down box when it is empty....Thanx
    >>>>> Bob
    >>>>> "Bob" <xxx@xx.xx> wrote in message
    >>>>> news:e84cte$pdv$1@lust.ihug.co.nz...
    >>>>>> Oops, what is wrong with this added Unique Values to yes
    >>>>>> SELECT *
    >>>>>> FROM tblHorseOwnerPercentage
    >>>>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>>> WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
    >>>>>>
    >>>>>> "Bob" <xxx@xx.xx> wrote in message
    >>>>>> news:e84cfo$oue$1@lust.ihug.co.nz...
    >>>>>>> Brilliant Got it, :) Can I do a sort on Column1 (OwnerName)
    >>>>>>> Thanx..Bob
    >>>>>>> SELECT *
    >>>>>>> FROM tblHorseOwnerPercentage
    >>>>>>> WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
    >>>>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     

Share This Page