Aller au contenu principal

Recherche

Recherche

Date Conversion From Mm/dd/yyy To Dd/mm/yyyy

Commentaires

5 commentaires

  • Avatar
    Ian Cummings
    Modérateur
    1. For your database connected text object, be sure to specify some sort of valid date for the "Sample Data" in order to avoid and VB Script errors at design time.

    2. Click the "More Options" button, select the "VB Scripting" tab and then for the "OnProcessData" VB Script, enter something like the below expression to reformat the date.

    [code]value = Day(value) & "/" & Month(value) & "/" & Year(value)[/code]
    0
  • Avatar
    Legacy Poster
    [quote name='Ian C - Seagull Support' timestamp='1322060408' post='1134']
    1. For your database connected text object, be sure to specify some sort of valid date for the "Sample Data" in order to avoid and VB Script errors at design time.

    2. Click the "More Options" button, select the "VB Scripting" tab and then for the "OnProcessData" VB Script, enter something like the below expression to reformat the date.

    [code]value = Day(value) & "/" & Month(value) & "/" & Year(value)[/code]
    [/quote]

    Thanks a lot its working if i am giving value hard cored but if i place a data base field instead of value its violating
    0
  • Avatar
    Ian Cummings
    Modérateur
    Like I said, replace the sample data for your database connected sub-string with a valid date. The sub-string is still connected to the database field, but for display purposes it shows a valid date of some kind.
    0
  • Avatar
    Legacy Poster
    [quote name='Ian C - Seagull Support' timestamp='1322064465' post='1137']
    Like I said, replace the sample data for your database connected sub-string with a valid date. The sub-string is still connected to the database field, but for display purposes it shows a valid date of some kind.
    [/quote]
    I have tried as you said even though i got a runtime error like "bartender: warning message #5901" and i am not able to view preview
    This is what i placed in vb script:
    value = Day(Format.NamedSubStrings("date").Value) & "/" & Month(Format.NamedSubStrings("date").Value) & "/" & Year(Format.NamedSubStrings("date").Value)
    0
  • Avatar
    Ian Cummings
    Modérateur
    Ah okay, I think I know the problem. Try this instead:

    value = Mid(Format.NamedSubStrings("date").Value),4,2) & "/" & Left(Format.NamedSubStrings("date").Value),2) & "/" & Right(Format.NamedSubStrings("date").Value),4)
    0

Vous devez vous connecter pour laisser un commentaire.