Hi
I have date value like this 07/08/2024.I want to get values before second "/" i.e 0708 in Crystal report formula.
. If date is 7/08/24 then 0708
Thanks
Hi
I have date value like this 07/08/2024.I want to get values before second "/" i.e 0708 in Crystal report formula.
. If date is 7/08/24 then 0708
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 16, 2024, 12:33 PM EST
use this formula on your date field,
Replace(Split({YourDateField}, "/")[1] + Split({YourDateField}, "/")[2], "/", "")Naveen KumarRank #249 · 10K reputationPosted Dec 17, 2024, 12:04 AM EST
Check the below formula. Replace {YourDateField} with the actual name of your date field in the report.
Local StringVar DateString := ToText({YourDateField}, "dd/MM/yy"); Local StringVarArray DateParts := Split(DateString, "/"); Local StringVar DayPart := Right("0" + DateParts[1], 2); // Ensures 2 digits for day Local StringVar MonthPart := Right("0" + DateParts[2], 2); // Ensures 2 digits for month DayPart + MonthPartMuhammad Imran AnsariRank #326 · 7.6K reputationPosted Dec 16, 2024, 3:42 PM EST
// Assuming your date field is named {YourDateField}, convert it to a string if needed
Local StringVar dateString := ToText({YourDateField}, "MM/dd/yyyy");// Replace "/" with an empty string and then take the first 4 characters
Left(Replace(dateString, "/", ""), 4)