IIF IsNothing expression example - ssrs-2008

I'm using SSRS 2008 and am trying to create an expression where if date field A is greater than date field B or date field A is NULL then this filter will select this record. How do I do this?
I tried this expression to select NULL date fields, but it is not working. I set the datatype to "Text" for now--should I set this to boolean instead? If so, then how can I modify this expression?
=iif(isnothing(Fields!A_date.Value),"yes","no")

=IIF((CDATE(Fields!A_date.Value)>CDate(Fields!B_date.Value)) OR ISNothing(Fields!A_date.Value),"Yes","NO")
Try this !!!

Related

Set a custom dafault date for a nullable date column on Laravel

I want to set a default date of 1900-01-01 on a nullable date field.
I've tried this
$table->date('fecha_nacimiento')->nullable()
->default(\Carbon\Carbon::make('1900-01-01')->toDateTimeString());
Also
$table->date('fecha_nacimiento')->nullable()
->default(\Carbon\Carbon::make('1900-01-01'));
Also
$table->date('fecha_nacimiento')->nullable()->default('1900-01-01');
When I save from the browser with the HTML date input not set, it saves the date field as null.
The default value on the field only applies when no value, not even null, is assigned.
The blank value is most likely from a blank input from a form. Also, if you are using eloquent mass assignment like so,
$model->fill($request->all());
In this case, your date field is set to null and your insert statement will look like this,
INSERT INTO table_name (fecha_nacimiento, ...)
VALUES (null, ...);

Converting null values in date column to "N/A" in tableau

We have a date column which has a lot of Null Values. We want to replace these null values with "N/A", however for date columns I dont see aliases where I can change it with a click of a button.
So I wrote the following calculation :
IFNULL(str([Arrival Date]),"N/A")
Since this calculation is now a string, I cannot change the format of the date like I could for any normal date column.
Since this new calculated field has string values, I know i cannot convert it back to date. So how can i now handle the date formats ?
BLANK is the default value for NULLin Tableau.
Set how tableau treats these values
Right Click Measure> Format
Select Special Values (bottom most) and
change the value to NA
See this screenshot
In case it's a discrete value refer to Tableau KB: Replacing Null Literals

Datetime in Crystal report

How do I set only the date in Crystal report? Also how do I remove the comma from numbers in the ID column?
I created a formula for fromdate and todate like this. How do I set only the date in fromdate and todate and remove the comma from numbers in the ID column?
Here is how I fetch the ID column from the database:
Try this:
To convert date use
CDate(datetime field);
To remove , use
ToText(ID,'#') //If this one throws error or
ToText(ID,0,"")
In your date formula use:
date({table.field})
To remove the comma see:
How to remove comma from crystal report string and from integer field
To Remove ','
Write click on Id and Select Format Objects
and select appropriate option you want to use.
be Sure Id is not string or other than numeric data type.

TALEND - tmap component default Date

I am using a tMap component. I have a date field with default pattern as "dd-MM-yyyy". I just need to insert a Blank Value. i tried '01-01-1900',"",TalendDate.getCurrentDate() : However they gave errors.
Is there a way to could only insert 01-01-1900 or a Null Value with datatype as DATE ?
Try TalendDate.parseDate() function...
you can simply either type null in expression in tmap or use TalendDate.parseDate("yyyy-MM-dd", "1900-01-01")

SSRS expression fails for IIF date with #error

A stored procedure is included in a report builder file of type rdl. the stored procedure has many fields. One of the fields returns a date (not datetime). The desired outcome in the report is to show the date only and empty field if no date is returned.
With just the field value the result shows empty field when the date is null otherwise shows the date with a datetime value.
Using IIF to check the value for 'nothing' as shown below.
=IIF(Fields!myDate.Value Is Nothing,"",Fields!myDate.Value)
The output is the same. A datetime value is shown when date is available.
Attempting to use the shortDateString() function yields the correct result in when a date is present but #Error when a date is NOT present. This is the statement:
=IIF(Fields!rlsPromoDate.Value Is Nothing, "",
Fields!rlsPromoDate.Value.ToShortDateString())
The version below was attempted. No errors resulted however the date was not returned but this was "Microsoft.ReportingServices.ReportProcessing.OnDemandReportObjectModel.FieldImpl".
=IIF(Fields!myDate.Value Is Nothing,"", String.Format("{0:MM/dd/yyyy}",
Fields!myDate))
Please advise if there is a solution.
Try the following:
=IIF(Fields!rlsPromoDate.Value Is Nothing, "", Format(Fields!rlsPromoDate.Value, "dd/MM/yyyy"))
or whatever date format you'd actually like to use.