Solved

Day of Week   Weekday function

Posted on 2014-04-29
6
732 Views
Last Modified: 2014-04-29
Expr1: (WeekdayName([DateofImport],True,1))


I'm trying to get this to work...based on evaluating a date field..

but I get a "Func#"  error...

How can I adjust the syntax ?

I'd rather do this in a single step, instead of evaluating as a number...and then doing a secondary update query...

if I can convert the [Date of import] to a numeric field...and then get the Day of Week text...that'd be ideal.


Thanks for any guidance.
0
Comment
Question by:James Powell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 40029699
Format(Weekday([Date of import]), "ddd")

or

Format(Weekday([Date of import]), "dddd")
0
 
LVL 11

Expert Comment

by:Simone B
ID: 40029700
SELECT DATENAME(dw,DateofImport) FROM TableName

Edit: Sorry, just saw the categories. The above is SQL, not Access. Not sure which you're looking for?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40029706
try this, you may need to change the position of the days, depending on your settings


choose(weekday([Date of import]), "Mon","Tue","Wed","Thu","Fri","Sat","Sun")
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 37

Expert Comment

by:PatHartman
ID: 40029713
I'm not sure why you are updating a table with this value.  You should be calculating it whenever you need it.

This is a two step process.  If you read the help entry for Weekdayname or even read what intellisense displays when you enter the expression, you will see that the first argument is a long integer.  That means that it isn't a date.  So first you need to find the day of the week for the particular date and only then can you convert that into a name for the weekday.

Expr1: (WeekdayName(WeekDay([DateofImport],1),True,1))


Wow!!!!  A lot of people posted ahead of me while I answered the phone.  Dale's answer is simpler than mine since it only uses a single function.
0
 
LVL 1

Author Closing Comment

by:James Powell
ID: 40030038
Works amazing!  Thank you very much for your help!
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 40030354
glad I could be of assistance.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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