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

last year table

Hi,

I need to create a Last Year table and that's what I do:

original table:

Timestamp,

addyears (Timestamp,-1) as Timpestamp_ly,

net_price,

status;

LY_table:

Timestamp as Timpestamp_ly,

net_price as net_price_ly,

status;

The problem of this structure is that LY_table uses the status field of the current timestamp, I mean that if the status of the actual timestamp doesn'tmatch with the status of the last year timestamp the LY_table doesn't work.

The only way it works is if I name the status field as status_ly in the LY_table but I need to keep the old name to compare both net_prices in a graph

I don't know if it's clear...

Any Idea??

Regards, David

4 Replies
Not applicable
Author

I would use a date function while look to use Year from Timestamp

like Time stamp gives u complete date and time for particular field

Date(Timestamp, 'MM/DD/YY') gives you just date from same time stamp

Not applicable
Author

Sorry, I don't understand...

Not applicable
Author

First of all r u talking abt tables in QV or on DB side?

Not applicable
Author

QV tables,

Do you mean trunking by day to get more range of Status?

Thanks,

David