Convert month to numeric

Dear all,

i using vfp7. Do there a function i can convert "June" to 6 i mean to numeric formats.

Thanks in advance.




Answer this question

Convert month to numeric

  • Tom Stewart

    sorry i dun un wat is -1,1,1,1+2+4+8 even i had read help files haha

    please explain .... thanks



  • BKRIS

    AFAIK there is no function in VFP that does parse a monthname to its numeric format nor parse a date/datetime that contains monthnames (such as June 3,2006 to 6/3/2006).

    You can create your own MonthName2Numeric function. ie:

    #define Months "January,February,March,April,May,June,July,August,September,October,November,December"

    ALines(aMonths,Months,.t.,',')
    "June is", Ascan(aMonths,'june',1,-1,1,1+2+4+8)


  • Garthower

    From VFP help:

    "ASCAN(ArrayName, eExpression [, nStartElement [, nElementsSearched [, nSearchColumn [, nFlags ]]]])"

    nStartElement: 1

    nElementsSearched: -1 && all

    nSerachColumn: 1

    nFlags: bitmask (1+2+4+8 sets bits 0,1,2,3)

    From VFP help:

    "The bit values are as follows:

    Bit Description
    0 Case Insensitive bit
    1 Exactness ON bit (Only effective if bit 2 is set)
    2 Override system Exact setting bit
    3 Return row number if 2D array

    nFlags applies only to the ASCAN( ) function and does not affect settings for SET EXACT."


  • George Waters

    If you are using VFP 9.0 you could use the new ICASE() function.

    Dennis


  • Jon Warren

    thanks for your explanantion.

    i just get my vfp8 cd. for vfp9 is tat much difference from vfp7 or vfp8 at 1st i tout i solve myy problem using do case for each month ... but now thanks to solve my puzzle hehe thanks.



  • Convert month to numeric