Results 1 to 8 of 8
  1. #1
    Join Date
    May 2003
    Posts
    3

    Cool Unanswered: hi there i need some help because im new to dba stuff

    SELECT GenData.DOB FROM GenData AS GenDataWHERE (GenData.DOB Is Null)
    INSERT INTO GENDATA (REMARKS) VALUES ('The DOB for this prisoner is Unknown');

    what do i need to do to make this possible what iam trying to do is find all the null dob's and fill the record with a statement with that table,


    i am getting the error 3075 missing operator in query expression
    Last edited by rc3038; 05-11-03 at 18:51.

  2. #2
    Join Date
    Oct 2002
    Posts
    61

    Re: hi there i need some help because im new to dba stuff

    Just looking at your code I think the error you are receiving is because there is no space between the GenData allias and the WHERE. Assuming that you cut and pasted your sql into your message.


    Cheers

  3. #3
    Join Date
    May 2003
    Posts
    3

    Re: hi there i need some help because im new to dba stuff

    Originally posted by Chumpie999typla
    Just looking at your code I think the error you are receiving is because there is no space between the GenData allias and the WHERE. Assuming that you cut and pasted your sql into your message.


    Cheers

    tried that didnt work still gave me a error missing operator in query expression

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    try the select part of the statement without the insert. Are you doing this through the query design?

  5. #5
    Join Date
    May 2003
    Posts
    3
    Originally posted by axsprog
    try the select part of the statement without the insert. Are you doing this through the query design?
    well i guess i need to run a update statement, i was trying to find all of the records that had blank dob and then insert a statement to a text field. so the select without the insert would pointless unless i wanted to fix all of the records by copy and pasteing into the records in a query (3000+ records)

  6. #6
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    Not pintless - it is called divide and conquer, if a SQL statement does not work, you break it down bit by bit and see where it breaks.

    Also copy and aste is not a solution as you know, but dao or ado would work

    dim db as database
    dim rst as recordset
    set db = currentdb 'or you db path or odbc source
    set rst = db.openrecordset (select statement here) 'in quotes
    dim x
    x = 0
    rst.movefirst
    do until rst.eof
    If is null ([rst!myfield]) or [rst!myfield] = "" Then
    rst.edit
    rst!myfield = "My text here"
    rst.update
    X = x + 1
    end if
    rst.movenext
    Loop
    msgbox "process complete. There were.." & x & "..records affected."

    rst.close
    set rst = nothing

  7. #7
    Join Date
    Apr 2002
    Location
    London
    Posts
    10

    Re: hi there i need some help because im new to dba stuff

    Originally posted by rc3038
    SELECT GenData.DOB FROM GenData AS GenDataWHERE (GenData.DOB Is Null)
    INSERT INTO GENDATA (REMARKS) VALUES ('The DOB for this prisoner is Unknown');

    what do i need to do to make this possible what iam trying to do is find all the null dob's and fill the record with a statement with that table,


    i am getting the error 3075 missing operator in query expression
    I think what you need run is this fairly straightforward SQL statement

    Update GenData
    Set Remarks='The DOB for this prisoner is Unknown'
    Where GenData is null


    It's always simpler than you think

  8. #8
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    I agree , but if sql is failing for some 'unknown' reason, one should always try another approach.

    Good solution - though problem may not reside in the sql statement at all.

Posting Permissions

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