How to compare birthdate with today

How to compare birthdate which available in excel sheet(100 date) with today date and send the email notification…

1 Like

@Shubham_Akole How do you want to Compare the Dates?

1 Like

give me any solution

1 Like

@Shubham_Akole I meant Do you want the Birth date to be Equal to Today’s Date, or Birth date <= Today’s Date, or Birth Date >= Today’s Date? :sweat_smile:

1 Like

use if condition like this
row(“yourBirthdateColumn”).ToString = Date.Now.Tostring

1 Like

But, In what format i will insert date in excel column eg. dd/mm/yyyy or mm/dd/yyyy
in what format above expression is done…

1 Like

row(“yourBirthdateColumn”).ToString = Date.Now.Tostring(“dd/MM/yyyy”)
you can change!

1 Like

@Shubham_Akole But can you tell us what kind of operatin you want to Perform? An Equals , Less than or Greater than operation :sweat_smile:

1 Like

equal
if equal then send the birthday notification via email

1 Like

@Shubham_Akole ok, Can you Read Excel And use a For Each Loop to Loop through the Date Values and Show the Date value in a Message Box?

1 Like

Hi… you can try with multiple ways to check dates based on the requirements
1 - with date compare
DateTime.Compare(date1, date2) - (return the integer)
2 - date difference
DateDiff(date1, date2)
3 - with Operators like = <>

1 Like

No, Show the Name of employee which has birthday on today

1 Like

@Shubham_Akole If there are many Employee that have birthday on Today’s Date, then what would you like to do ?

1 Like

Then send the name of all employee …
in 1 mail…

1 Like

@Shubham_Akole Then you want a List of Employess who have Birth date’s on Today’s Date?

1 Like

yes.

1 Like

@Shubham_Akole Can you try this :
After you use Read Range and get the Datatable, use that Datatable in this query
assign this Statement to an Array of Object variable, Change the Column names as per your Excel Sheet

employeeNames = (From x in DT where CDate(x(“yourBirthdayColumn”).toString).ToString(“dd/MM/yyyy”).Equals(Now.ToString(“dd/MM/yyyy”)) Select x(“EmployeeNameColumn”)).toArray

1 Like

if any workflow available then please share…

1 Like

@Shubham_Akole Can you send your Excel File?

1 Like

sorry,because excel file contain All data of employee…
But excel file contain…
EmployeeID NameOfemployee Email Birthdate

1 Like