Hey @fairymemay
Is the Approve date a date time variable and which is format is it currently ?
Thanks
#nK
Hey @fairymemay
Is the Approve date a date time variable and which is format is it currently ?
Thanks
#nK
@Nithinkrishna yes approveDate as Datetime
variable approveDate = DateTime.ParseExact(ApproveDateStr,“dd MMM”,System.Globalization.CultureInfo.InvariantCulture)
@Nithinkrishna I read ApproveDate after - and If today month3 —> I assume year now but if today month1 —> I assume previous year.
But use column Issue Date same.
Hey @fairymemay
Try this if it helps…
nmnithinkrishna_BuddishtCalendarDateComparison.zip (2.4 KB)
Thanks
#nK
Hey @fairymemay
Kindly use this in your query condition,
DateTime.ParseExact(x("Issue Date").ToString, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture) <= Date.ParseExact(x("วันที่รับเล่ม (<=)").ToString.Trim,"dd/M/yyyy",System.Globalization.CultureInfo.InvariantCulture)
The above condition will only do the date column comparison as requested for other columns you can add along with this.
Thanks
#nK
If I don’t use column วันที่รับเล่ม
Because I read value already in variable DateReceived as string = 04/05/2022 (dd/mm/yyyy)
Sorry, unable to understand. Kindly explain.
Thanks
#nK
@Nithinkrishna From your suggest
Date.ParseExact(x(“วันที่รับเล่ม (<=)”).ToString.Trim,“dd/M/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
If I want read data in Date.ParseExact(x(“วันที่รับเล่ม (<=)”).ToString
Because I have variable Example 18/1/2022 as string
How to edit your code?
Yes the above code converts string to date by itself.
That’s is what you need I believe ?
Okay @fairymemay Got it.
You can just replace this x(“วันที่รับเล่ม (<=)”).ToString.Trim
with your variable
Thanks
#nK
Hey @fairymemay
Kindly show the date value please which you are passing through that variable ?
Thanks
#nK
Hey @fairymemay
It’s due to the format conflict.
Replace the format from the above as MM/dd/yyyy
.
Hope this helps
Thanks
#nK
@Nithinkrishna If I want change from column Issue Date to column วันรับเล่ม as below.
If file excel column วันรับเล่ม as format text
How to edit code from below?
DateTime.ParseExact(x(“Issue Date”).ToString, “yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture)
Hey @fairymemay
Please find the updated below,
ateTime.ParseExact(x(“วันรับเล่ม”).ToString, “dd/MM/yyyy HH:mm”, System.Globalization.CultureInfo.InvariantCulture)
Thanks
#nK
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.