DatePart WW

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Halo,

I need to extract the week and year from a datefield in the format ww-yyyy
e.b 02-2004

The below code gets the job done but i can't figure out how to get a leading
0. Tried the format command by no luck..

Any suggestions on how to acomplish this?

Week:DatePart("ww";[DateField]) & "-" & Year([DateField])

01-10-2004 should give the result 02-2004 in stead of 2-2004 (as the above
code does).


Regards,
Harmannus
 
Harmannus wrote:

Week:format(DatePart("ww";[DateField]),"00) & "-" & Year([DateField])
 
Thanx for the reply!

Works fine!

Hoi Bas,

<NL>Dank voor de snelle reactie! Mooie familiefoto's. Jouw kleine doet het
zware programmeer werk :-)</NL>


Bas Cost Budde said:
Bas Cost Budde wrote:

That should have been
Harmannus wrote:
Any suggestions on how to acomplish this?
Yes: my suggestion is

Week:format(DatePart("ww";[DateField]),"00) & "-" & Year([DateField])
 
Back
Top