I am trying to calculate Month Name based on the Datepart calculation in SSRS.This code is working but with a warning..
=Switch(DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=12,"December",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=11,"November",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=10,"October",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=9,"September",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=8,"August",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=7,"July",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=6,"June",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=5,"May",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=4,"April",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=3,"March",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=2,"February",
DATEPART(DateInterval.Month,Fields!TRANSACTION_DATE.Value)=1,"January")
Warning :
[rsRuntimeErrorInExpression] The Value expression for the field ‘MONTH_NAME’ contains an error: Argument 'VarExpr' is not a valid value.
Please suggest how to remove this error.
Based on your expression, you should be able to use a much simpler expression with different date functions:
=MonthName(Month(Fields!TRANSACTION_DATE.Value))
Related
I have a problem with the Cloud DB
Message:{"defaultName":"AGCError","name":"database-server","errorCode":{"code":"2052","message":"the input object is invalid."}}
I don't know what could be the reason ?
As per the Huawei Documentation, The error code 2052, it is described as “invalid input object”. So please check your input value or object
Below might be the causes. Please check:
Check any field longer input values which you declared as string. Because string data type field maximum value range is 200 character only. If the string contains more than 200 characters, you are advised to use the Text type. Refer -
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-clouddb-data-type-0000001080815898#EN-US_TOPIC_0000001176121166__en-us_topic_0000001127251477_table2376546172218
Check the date field format. Because the date format should be (yyyy-MM-dd HH:mm:ss sss) like below
I have an SSRS Report I've created with a "Date/Time" Parameter I have created. I am trying to create a Parameter that Defaults to the Current Year. For example in "2020" I want the Paramater to default to "01/01/2020" when we hit 2021 I want it to default to "01/01/2021" Here is what I have tried. For my default value in the parameter I have the following expression with no success.
=CDate(Year(Now())+"-"+Month(01)+"-"+Day(01))
You can do this using the following expression.
=DateSerial(YEAR(Today()), 1, 1)
You can use CDate but that relies on strings. DateSerial is easier to work with in your scenario.
I am a newbie Talend developer, need a help with context variables. I searched here if there is a solution for similar approach, didnt find it.
In my query I have to use this date range function:
Date BETWEEN to_char((add_months(TRUNC(SYSDATE,'MM'),-2)),'YYYYMMDD')
AND to_char(LAST_DAY(TRUNC(SYSDATE,'MM')),'YYYYMMDD')
We need to use context variable to take advantage to run different date range during runtime. Above function, I replaced in the query with (date between ="+context.daterange+") and trying to plug these functions to Context - value as tree as below:
to_char((add_months(TRUNC(SYSDATE,'MM'),-5)),'YYYYMMDD')'AND'to_char(LAST_DAY(TRUNC(SYSDATE,'MM')),'YYYYMMDD'), I get below error:
java.sql.SQLException: ORA-00905: missing keyword
If I use hard coded value on "Value as tree" context as below then works
"'20150301'and'20150831'"
Trying to replace this with the function. How can I combine that function with AND.
My tJavacode has
context.DATE = (String)row1.NDate;
Can you please help?
Thanks
Date cannot be between two texts. Since your context variables is a String then use to_date function:
"select ... where my_date between to_date("
+TalendDate.formatDate("ddMMyyyy",TalendDate.addDate(new Date(), 2, "MM"))+
",'DDMMYYYY') and
+TalendDate.formatDate("ddMMyyyy",TalendDate.addDate(new Date(), 5, "MM"))+
");"
I have a DateTime property.
I want to check if a date is equal to the date in my property and it has to be done purely in the url query parameters available in OData v4.
This doesn't work :(
GET ~/odata/foo$filter=date(myProperty) eq date(1980-01-01)
Yes I can use greater then or equal but that's is already working as intended. It's equal and not equal that's the problem.
From ABNF rules, Date value is a value with format:
dateValue = year "-" month "-" day
So, I think you shouldn't add date prefix. That's:
GET ~/odata/foo$filter=date(myProperty) eq 1980-01-01
Here's some test cases provided by ODataTeam:
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L169-L171
and
https://github.com/OData/WebApi/blob/master/OData/test/E2ETest/WebStack.QA.Test.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs#L208-L212
Besides, there's a simple tutorial you can refer to:
http://odata.github.io/WebApi/#04-04-date-and-timeofday-support
Thanks. Hope it can help.
I have month parameter in JasperReports report which will be changed into title of month. I didn't use any query to change them. I try this code:
$P{MONTH}.intValue()==1?"JAN":
$P{MONTH}.intValue()==2?"FEB":
$P{MONTH}.intValue()==3?"MAR":
$P{MONTH}.intValue()==4?"APR":
$P{MONTH}.intValue()==5?"MAY":
$P{MONTH}.intValue()==6?"JUN":
$P{MONTH}.intValue()==7?"JUL":
$P{MONTH}.intValue()==8?"AUG":
$P{MONTH}.intValue()==9?"SEP":
$P{MONTH}.intValue()==10?"OCT":
$P{MONTH}.intValue()==11?"NOV":"DEC";
but it didn't work. Could anyone know the solution for me?
This is what I use
$F{MONTH}.intValue()==1?"JAN":
$F{MONTH}.intValue()==2?"FEB":
$F{MONTH}.intValue()==3?"MAR":
$F{MONTH}.intValue()==4?"APR":
$F{MONTH}.intValue()==5?"MAY":
$F{MONTH}.intValue()==6?"JUN":
$F{MONTH}.intValue()==7?"JUL":
$F{MONTH}.intValue()==8?"AUG":
$F{MONTH}.intValue()==9?"SEP":
$F{MONTH}.intValue()==10?"OCT":
$F{MONTH}.intValue()==11?"NOV":"DEC"
It may be the semi-colon at the end that's the problem
It may also be that you are using a Parameter - .intValue() doesn't seem valid for a Parameter