Append Dates-Excel output

idontknowidontknow Member Posts: 66
in a report which has excel output,in one field i need to print like this : "Sep 26th to Oct 2nd"

I can get both the dates but want to know how to append both the dates in a single line?

Comments

  • navfreshernavfresher Member Posts: 44
    idontknow wrote:
    in a report which has excel output,in one field i need to print like this : "Sep 26th to Oct 2nd"

    I can get both the dates but want to know how to append both the dates in a single line?

    Any solution please?
  • SavatageSavatage Member Posts: 7,142
    have you looked at the FORMAT property?

    StartDateTxt := FORMAT(Date1,0,'<Month Text,3> <Day>.');
    EndDateTxt := FORMAT(Date2,0,'<Month Text,3> <Day>.');
    DateRangeTxt := StartDateTxt+' to '+EndDateTxt;

    You can probably do it all in one line of code
    DateRangeTxt := (FORMAT(Date1,0,'<Month Text,3> <Day>.'))+' to '+(FORMAT(Date2,0,'<Month Text,3> <Day>.'))

    then export that variable to excel.
    Is this what you're looking for?
  • SaalekSaalek Member Posts: 181
    Hi

    If you record a macro in Excel, the function is that
    Selection.NumberFormat = "[$-C0A]d-mmm;@"
    

    Bye
Sign In or Register to comment.