Formatting da6e as week # in access query

Posted on 2012-08-16
Medium Priority
Last Modified: 2012-08-16
I would like to format a week in an access query to show the week #.  Does anyone know the proper format?
Question by:marku24
  • 4
LVL 66

Expert Comment

by:Jim Horn
ID: 38301869
?Format(now(), "ww")

As apparently we're in the 33rd week of the year.

BUT ... this is calendar week, so if you have a different definition of week number, you'll need to spell that out.

Author Comment

ID: 38301890
I got that to work in the query but it is formatting as a date:  

33/_/_    How do i get it to format as a number.  the column format option has nothing in there so i can't select "number".
LVL 66

Accepted Solution

Jim Horn earned 1000 total points
ID: 38301916
>33/_/_    How do i get it to format as a number.
Not really sure what your asking.

There's a number of convert to number formats:

CLng(anything) will return the Long Integer (i.e. no decimal values) numeric value.
CDbl(anything) will return the Double (with decimal values) numeric value.
LVL 66

Expert Comment

by:Jim Horn
ID: 38301924
If you're trying to convert the 33 week...

CInt(anything) converts to a small integer, which is +/- 32,000-ish.
CByte(anything) converts to a byte, which is 0 to 255.
LVL 66

Expert Comment

by:Jim Horn
ID: 38302108
Thanks for the greade.  Good luck with your project.  -Jim

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question