Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
simoevry
Contributor
Contributor

Show Last day -1 helppp

Hii

I want to show last day but his dont work for me

load

[selling],

[Date],

Year (date(date#([Date],'YYYYMMDD'),'YYYYMMDD')),

FROM [lib://AttachedFiles/Rp2.xls]

(biff, embedded labels, table is Rp2$)

Where

year (date(date#(Date,'YYYYMMDD'),'YYYYMMDD')) = year(now())

AND MONTH (date(date#(Date,'YYYYMMDD'),'YYYYMMDD'))=Month(Now())

AND DAY(date(date#(Date,'YYYYMMDD'),'YYYYMMDD')=Day(Now()-1));

plzz help me

10 Replies
vishsaggi
Champion III
Champion III

What is the problem you are getting here? And your where condition looks little unfinished.

Try the one highlighted in red.

LOAD

[selling],

[Date],

Year (date(date#([Date],'YYYYMMDD'),'YYYYMMDD')),

Where  year (date(date#([Date],'YYYYMMDD'),'YYYYMMDD')) = year(now()) AND

MONTH (date(date#([Date],'YYYYMMDD'),'YYYYMMDD'))                          AND  --> Where is the condition for this?

DAY(date(date#([Date],'YYYYMMDD'),'YYYYMMDD'))            = Day(Date(Date(Date#(Now(), 'DD/MM/YYYY hh:mm:ss')-1, 'MM/DD/YYYY'), 'YYYYMMDD'))

simoevry
Contributor
Contributor
Author

Ok this is all my code

load

[selling],

[Date],

Year (date(date#([Date],'YYYYMMDD'),'YYYYMMDD')),

FROM [lib://AttachedFiles/Rp2.xls]

(biff, embedded labels, table is Rp2$)

Where

year (date(date#(Date,'YYYYMMDD'),'YYYYMMDD')) = year(now())

AND MONTH (date(date#(Date,'YYYYMMDD'),'YYYYMMDD'))=Month(Now())

AND DAY(date(date#(Date,'YYYYMMDD'),'YYYYMMDD')=Day(Now()-1));

vishsaggi
Champion III
Champion III

Remove that extra comma in your load statement for your field year. And can i know what is the date format for the field [Date] in excel ?

vishsaggi
Champion III
Champion III

Try this ? If this doesnt work try share a sample data with expected output.

load

[selling],

[Date],

Year (date(date#([Date],'YYYYMMDD'),'YYYYMMDD'))

FROM

[lib://AttachedFiles/Rp2.xls]

(biff, embedded labels, table is Rp2$)

Where

year(date(date#(Date,'YYYYMMDD'),'YYYYMMDD')) = Year(Date(Date(Date#(Now(), 'DD/MM/YYYY hh:mm:ss'), 'MM/DD/YYYY'), 'YYYYMMDD'))  AND

MONTH(date(date#(Date,'YYYYMMDD'),'YYYYMMDD'))= Month(Date(Date(Date#(Now(), 'DD/MM/YYYY hh:mm:ss'), 'MM/DD/YYYY'), 'YYYYMMDD')) AND

DAY(date(date#(Date,'YYYYMMDD'),'YYYYMMDD'))  = Day(Date(Date(Date#(Now(), 'DD/MM/YYYY hh:mm:ss')-1, 'MM/DD/YYYY'), 'YYYYMMDD'));

simoevry
Contributor
Contributor
Author

Is show nothing  date is blank for me plzz help me guys I want solution if is possible another method advice me

tresesco
MVP
MVP

Not sure what exactly are you trying to achieve. You may try like:

Load

     [selling],

     Date(Date#([Date],'YYYYMMDD')) as Date,

     Year (Date#([Date],'YYYYMMDD')) as Year

FROM [lib://AttachedFiles/Rp2.xls]

(biff, embedded labels, table is Rp2$)

Where  Floor(Date#([Date],'YYYYMMDD')) =today()-1;

vishsaggi
Champion III
Champion III

Can you share a sample app and expected output if possible for a quick resolution?

simoevry
Contributor
Contributor
Author

ok thanks for all

the problem is when the day is 01/03/2017 the last day is  28/02/2017 so is show me null or blank because impossible to comaparate betwen the month but after this is work 02/03/2017 _ 03/03/2017 all days is work but again the 31/03/2017 and 01/04/2017 is dont work again

vishsaggi
Champion III
Champion III

Did you try Tresesco's expression ? Can you share a sample data ?