How to compare birthdate which available in excel sheet(100 date) with today date and send the email notification…
@Shubham_Akole How do you want to Compare the Dates?
give me any solution
@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?
use if condition like this
row(“yourBirthdateColumn”).ToString = Date.Now.Tostring
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…
row(“yourBirthdateColumn”).ToString = Date.Now.Tostring(“dd/MM/yyyy”)
you can change!
@Shubham_Akole But can you tell us what kind of operatin you want to Perform? An Equals , Less than or Greater than operation
if equal then send the birthday notification via email
@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?
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
3 - with Operators like = <>
No, Show the Name of employee which has birthday on today
@Shubham_Akole If there are many Employee that have birthday on Today’s Date, then what would you like to do ?
Then send the name of all employee …
in 1 mail…
@Shubham_Akole Then you want a List of Employess who have Birth date’s on Today’s Date?
@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
if any workflow available then please share…
@Shubham_Akole Can you send your Excel File?
sorry,because excel file contain All data of employee…
But excel file contain…
EmployeeID NameOfemployee Email Birthdate