Results 1 to 7 of 7

Thread: [RESOLVED] data report + sql statement

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    88

    Resolved [RESOLVED] data report + sql statement

    i created a data report. i grouped them by address using the properties of command1 in the data environment (meaning not using sql statement). it runs okay. but when i added sql statement on the properties also of command1, an error appears 'datafield 'command1.lname' not found

    SELECT STUD_NO, LNAME +','+ FNAME +' '+ MNAME AS STUD_NAME, ADDRESS, AGE FROM TBLSTUDENT

  2. #2
    Lively Member
    Join Date
    Jun 2006
    Location
    Chennai, India
    Posts
    87

    Re: data report + sql statement

    Quote Originally Posted by heavenscent29
    i created a data report. i grouped them by address using the properties of command1 in the data environment (meaning not using sql statement). it runs okay. but when i added sql statement on the properties also of command1, an error appears 'datafield 'command1.lname' not found

    SELECT STUD_NO, LNAME +','+ FNAME +' '+ MNAME AS STUD_NAME, ADDRESS, AGE FROM TBLSTUDENT
    In above query u have specified the Column name as STUD_NAME. There is no column in the name lName.

    Cud u understand?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    88

    Re: data report + sql statement

    yah, i undrstand. so, wht will i do? i tried this but the concatenation doesn't work

    SELECT STUD_NO, LNAME, FNAME, MNAME, LNAME +','+ FNAME +' '+ MNAME AS STUD_NAME, ADDRESS, AGE FROM TBLSTUDENT

  4. #4
    Lively Member
    Join Date
    Jun 2006
    Location
    Chennai, India
    Posts
    87

    Re: data report + sql statement

    what error do u get?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    88

    Re: data report + sql statement

    there's no error! it just disregard the concatenation that i made

  6. #6
    Lively Member
    Join Date
    Jun 2006
    Location
    Chennai, India
    Posts
    87

    Re: data report + sql statement

    U have to display concatenated value in the name of ''command1.STUD_NAME'. If it's truncated check with the length of the text box in ur report. In 'command1.lname' it will hold only the last name.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    88

    Re: data report + sql statement

    now i see the problem. i haven't updated my data report. i haven't deleted the fields for lname, fname and mname and changed to stud_name. tnx a lot 4 helping me!

Posting Permissions

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



Click Here to Expand Forum to Full Width