Results 1 to 6 of 6

Thread: SQL help, joining tables

  1. #1

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    SQL help, joining tables

    I have the following code:
    VB Code:
    1. rs2.Open "SELECT f.cost_per_meter, fu.length_used FROM fabric f, fabricused fu WHERE f.fabricno = fu.fabricno AND fu.garmentno = " & garmentid, conn

    Now how would I put cost_per_meter/len_used in to a variable, I've tried

    cpm = rs2!f.cost_per_meter
    cpm = rs2.fields("f.cost_per_meter).value

    and a few other variation to no avail... can anyone help me out here.
    If wishes were fishes we'd all cast nets.

  2. #2
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    cpm = rs2.fields("f.cost_per_meter")

    should work fine.....or if you wanted to format to currency

    cpm = Format(rs2.fields("f.cost_per_meter"), "Currency")

  3. #3
    Lively Member
    Join Date
    May 2001
    Location
    Akureyri, Iceland
    Posts
    69
    Code:
    cpm = rs2("cost_per_meter")
    The name of the table is not included in the name of the field.

  4. #4

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    hrm getting "Either EOF or BOF is true, or record deleted..." error
    If wishes were fishes we'd all cast nets.

  5. #5

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    ah nm something is wrong it my sql statement
    If wishes were fishes we'd all cast nets.

  6. #6

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    Got it working thanks for the help
    If wishes were fishes we'd all cast nets.

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