Good day,

I am having trouble with my dbase.

i have 2 tables first is the maintenance table while the other is transactional table.

on my maintenance table i have field(id, plan, material,type,percentage)
while on the transaction table (id,material,description)

here is my problem.

on the maintenance table let say

  id  plan   material   type          percentage
  1   1010   sample     in transit    100
  2   1011   example    haulage        50
  3   1012   mysample   production    100

based on the data above i want to select type and join it on the transactional table.
let say...

  id     material           description        INTRANSIT           HAULAGE           PRODUCTION
  1      sample             sample description 100                  0                  0
  2      example            example desc        0                  50                  0
  3      mysample           my sample desc      0                  0                  100

here is my problem.

on the maintenance table let say

id  plan   material   type          percentage
1   1010   sample     in transit    100
2   1011   example    haulage        50
3   1012   mysample   production    100

id     material           description        INTRANSIT           HAULAGE           PRODUCTION
1      sample             sample description 100                  0                  0
2      example            example desc        0                  50                  0
3      mysample           my sample desc      0                  0                  100

based on the data above i want to select type and join it on the transactional table.

id     material           description        INTRANSIT           HAULAGE           PRODUCTION
1      sample             sample description 100                  0                  0
2      example            example desc        0                  50                  0
3      mysample           my sample desc      0                  0                  100

can someone guide me with this.. thanks

HI, There is no any connectivity between two tables. you should have one..
Change your Transaction Table such as
ID,MID(FK,PK),Type,Rest of the field.

now using MID you can get the type from maintenance table and can insert into transaction table.

2Ways)
If you are using Web Application you can store into a session of maintenance type based on ID.
or
If you are using Windows you can store into a string. Create one class and call when it's require
Hope I ma clear and it will help you.

thanks RvSon for the reply, i already solve my problem, i use pivot..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.