Jump to content
  • 0

Calculatie met voorloop nul


sjuul

Question

Posted

Hallo,

 

Ik heb in een scriptstap een korte datum nodig, zoals 31122007. Nu doe ik dat met deze clalculatie:

 

 

Substitute ( GetAsDate ( Get ( CurrentDate ) ) ; "-" ; "" )

 

Maar die loopt stuk op het moment dat de dag of maand maar uit één getal bestaat. (02-12-2007 komt op 2122007, net als 21-02-2007)

 

Nu wil met voorloopnullen gaan werken, maar ik heb niet zo snel door hoe dat aan te pakken.

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Let ( [xCurrentDate = Get ( CurrentDate ) ] ;

 

Right (100 + Month (xCurrentDate) ; 2) & Right ( 100 + Day (xCurrentDate); 2) & Year (xCurrentDate) )

 

 

 

Deze is echter niet taalafhankelijk.

Edited by Guest
  • 0
Posted

Heb het hier eventjes gedaan door het datumveld zo te formateren dat er voorloopnullen instaan en geen separators. Dan heb je het meteen.

Als je de separators behoudt (bijvoorbeeld de slash), doe je het zo:

 

Substitute(GetAsText(Datum);"/";"")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...