0
votes

How would i convert the below excel Julian date formula into a formula i can use in SSRS 2008 r2

=IF(DATE(YEAR(TODAY()),1,A1)>TODAY(),
DATE(YEAR(TODAY())-1,1,A1)-(MONTH(DATE(YEAR(TODAY()),2,29))=2),
DATE(YEAR(TODAY()),1,A1))
1
There are many good references for expression examples in SSRS. You can reference them to get you started. Then you could post what you have tried and which part isn't working and we can help you from there. You will probably use the iif function and some other date functions. - mmarie

1 Answers

0
votes

Well, for starters, you'd have to replace all references to A1 with the field reference (Fields!Field_Name.Value) for which you will be placing in the tablix/report equivalent of A1.

IF()

In SSRS, IF() is IIF() in which you start with an expression to be evaluated followed by the result if true and the result if false. It's called IIF because it refers to the mathematical statement of If and only IF.

Date()

In SSRS, Date() is DateSerial() and uses the same setup as Date() in Excel, with Date([Year],[Month],[Day]).

That said, I believe your Excel formula is wrong. For instance, you cannot use a statement in the True section of the If formula without another evaluation expression around it. From what I'm seeing, what is it supposed to calculate when the Month of 2014-02-29 = 2? Look over your formula again and if there are typos, correct them and let me know via a comment. Then I'll come back and help you put together a complete calculation.

Hope this helps!