Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Update fields in table

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

  1. Tony Williams

    Tony Williams
    Expand Collapse
    Guest

    I have a table which has imported data. Not all the fields had data in them
    so I have a number of cases where the field is empty when it should in fact
    have a 0. I have written an update query but don't know what to put in the
    criteria. I have tried IsNull but get a type mismatch. Can anyone suggest
    anything I might try?
    Thanks
    Tony
     
  2. Loading...


  3. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Tony Williams wrote:
    > I have a table which has imported data. Not all the fields had data
    > in them so I have a number of cases where the field is empty when it
    > should in fact have a 0. I have written an update query but don't
    > know what to put in the criteria. I have tried IsNull but get a type
    > mismatch. Can anyone suggest anything I might try?
    > Thanks
    > Tony


    Is Null

    (two words)

    IsNull() is a VBA function
    Is Null is used in SQL/Queries

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  4. Tony Williams

    Tony Williams
    Expand Collapse
    Guest

    Thanks Rick
    Tony
    "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
    news:pu7rg.60401$Lm5.11287@newssvr12.news.prodigy.com...
    > Tony Williams wrote:
    >> I have a table which has imported data. Not all the fields had data
    >> in them so I have a number of cases where the field is empty when it
    >> should in fact have a 0. I have written an update query but don't
    >> know what to put in the criteria. I have tried IsNull but get a type
    >> mismatch. Can anyone suggest anything I might try?
    >> Thanks
    >> Tony

    >
    > Is Null
    >
    > (two words)
    >
    > IsNull() is a VBA function
    > Is Null is used in SQL/Queries
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
    >
     
  5. Tony Williams

    Tony Williams
    Expand Collapse
    Guest

    Rick I've tried that but when I click on Run the message says its update 0
    records even though I know some are empty? Any ideas
    Tony
    "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
    news:pu7rg.60401$Lm5.11287@newssvr12.news.prodigy.com...
    > Tony Williams wrote:
    >> I have a table which has imported data. Not all the fields had data
    >> in them so I have a number of cases where the field is empty when it
    >> should in fact have a 0. I have written an update query but don't
    >> know what to put in the criteria. I have tried IsNull but get a type
    >> mismatch. Can anyone suggest anything I might try?
    >> Thanks
    >> Tony

    >
    > Is Null
    >
    > (two words)
    >
    > IsNull() is a VBA function
    > Is Null is used in SQL/Queries
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
    >
     
  6. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Tony Williams wrote:
    > Rick I've tried that but when I click on Run the message says its
    > update 0 records even though I know some are empty? Any ideas
    > Tony


    Change the query to a select query and see if it returns any records.

    Are you sure this is a number field and not a text field that just happens
    to contain digital characters? If it's text those fields could contain zero
    length strings which are not the same as Null (tough they would look the
    same to you).


    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  7. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Try Is Null (i.e.: put a space between Is and Null)

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


    "Tony Williams" <tw@invalid.com> wrote in message
    news:%23DQ6sfPoGHA.4108@TK2MSFTNGP05.phx.gbl...
    > I have a table which has imported data. Not all the fields had data in

    them
    > so I have a number of cases where the field is empty when it should in

    fact
    > have a 0. I have written an update query but don't know what to put in the
    > criteria. I have tried IsNull but get a type mismatch. Can anyone suggest
    > anything I might try?
    > Thanks
    > Tony
    >
    >
     
  8. Tony Williams

    Tony Williams
    Expand Collapse
    Guest

    Rick I've run the select query and it doesn't return any records! However
    when I open my table there are definitely some records there that have
    nothing in them, the default is set to 0 but that doesn't appear either.
    This data was imported from an Excel spreadsheet, could it have imported a
    hard space? The field is a Number field and I'm not getting any format error
    messages. Incidentally when I open one of my forms which has controls based
    on these fields the controls are also blank even though at form level I have
    set the default to 0. Is it possible for a number field to contain a zero
    length string and if so how do I change it to 0. The reason I want to do all
    of this is that in some of my reports when I include these records I'm
    getting #Num and I wondered whether this was the reason.
    Thanks
    Tony
    "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
    news:WM7rg.60406$Lm5.17686@newssvr12.news.prodigy.com...
    > Tony Williams wrote:
    >> Rick I've tried that but when I click on Run the message says its
    >> update 0 records even though I know some are empty? Any ideas
    >> Tony

    >
    > Change the query to a select query and see if it returns any records.
    >
    > Are you sure this is a number field and not a text field that just happens
    > to contain digital characters? If it's text those fields could contain
    > zero length strings which are not the same as Null (tough they would look
    > the same to you).
    >
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
     
  9. Tony Williams

    Tony Williams
    Expand Collapse
    Guest

    Think I fixed it I did one field at a time and that seemed ok
    Tony
    "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
    news:WM7rg.60406$Lm5.17686@newssvr12.news.prodigy.com...
    > Tony Williams wrote:
    >> Rick I've tried that but when I click on Run the message says its
    >> update 0 records even though I know some are empty? Any ideas
    >> Tony

    >
    > Change the query to a select query and see if it returns any records.
    >
    > Are you sure this is a number field and not a text field that just happens
    > to contain digital characters? If it's text those fields could contain
    > zero length strings which are not the same as Null (tough they would look
    > the same to you).
    >
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page