SQL error

Discussion in 'Databases' started by june_c21, Nov 11, 2007.

  1. #1
    hi, can someone help me to identify what's wrong with this line of code? it return zero result.

    SELECT id, month, start_date, end_date, user.name, report.staff_no,details,amount,gl_code,user.bank,user.acc_no,status FROM user,report WHERE report.staff_no = user.staff_no
     
    june_c21, Nov 11, 2007 IP
  2. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #2
    use uniform referencing in your sql for all the fields you pull out, like table.field
    if you get no results, then no records exist in your table.
     
    olddocks, Nov 11, 2007 IP
  3. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #3
    unitedlocalbands, Nov 12, 2007 IP
  4. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #4
    june_c21 - What database are you using?

    Are the fields staff_no in the two tables report and user of same
    type and size?
     
    Kuldeep1952, Nov 13, 2007 IP