Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to load from more tables

Hi,

I'm a beginner and I'm working with the Personal edition. I've two tables for car rent:

table1

CARCODE          RENT PERIOD               CUSTOMER

C1                       20-07-11  -   25-07-11     C 

C1                       01-06-12  -   07-06-12     A

C2                       22-06-12  -   23-06-12     B

C3                       25-06-12      28-06-12      A

    

table2

CARCODE              ACTIVE PERIOD

C1                         01 - 01- 11   /  31 -12- 11

C1                         01 - 01- 12  /  31 - 12 - 12    

C2                         01 - 04 - 12  /  31 - 12 - 12

C3                         01- 06-  12   /  31- 12 - 12                              

I would have one table with all the information concerning 2012, like this:

CARCODE          RENT PERIOD               CUSTOMER   ACTIVE PERIOD

C1                       01-06-12  -   07-06-12     A                   01 - 01- 12   31- 12- 12

C2                       22-06-12  -   23-06-12     B                   01 - 04- 12   31- 12- 12

C3                       25-06-12      28-06-12      A                  01 - 06- 12   31- 12- 12

How can I arrange this table ?

Help please 

Thanks !!

Gr.

4 Replies
its_anandrjs

Hi,

When you load this two tables there is one unique filed key added named CARCODE automatically or

i want to ask do you want to load the data for 2012 only or want only single table.

Thanks & Rgds

Anonymous
Not applicable
Author

Hi,

I would load all the RENT PERIOD included into the current active period for a car. For example,

the car C1 , has two active periods: one for 2011 and another one for 2012.

2011 is expired, so I don't need to load it.

I hope you can help me

Thanks in advance

Gr.

its_anandrjs

Hi,

Load data only for active period like

LOAD CARCODE,

     [ACTIVE PERIOD],

     Right([ACTIVE PERIOD],2) as APYear

FROM

Location

where Right([ACTIVE PERIOD],2) = 12 ;

Thanks & Rgds

Not applicable
Author

you must bue use "join" and use "where" condition. load two tables and the join sentence will be helpfull to create one table with all fields, after that you can use where condition to see only 2012 values.