• subtract on date

    Author
    Topic
    #465972

    i have this var
    DATA_TIPOLOGIA=06/01/2010
    how to subtract one month and have DATA_TIPOLOGIA=06/12/2009
    note:
    DATA_TIPOLOGIA is dimensioned string

    Viewing 0 reply threads
    Author
    Replies
    • #1205607

      For example:

      Code:
      	Dim DATA_TIPOLOGIA As String
      	DATA_TIPOLOGIA = "06/01/2010"
      	DATA_TIPOLOGIA = DateAdd("m", -1, DateValue(DATA_TIPOLOGIA))
      	MsgBox DATA_TIPOLOGIA
      
      • #1205630

        For example:

        Code:
        	Dim DATA_TIPOLOGIA As String
        	DATA_TIPOLOGIA = "06/01/2010"
        	DATA_TIPOLOGIA = DateAdd("m", -1, DateValue(DATA_TIPOLOGIA))
        	MsgBox DATA_TIPOLOGIA
        

        work! tks.

    Viewing 0 reply threads
    Reply To: subtract on date

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: