[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Day of Week   Weekday function

Posted on 2014-04-29
6
Medium Priority
?
849 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 earned 2000 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
Industry Leaders: 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!

 
LVL 39

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
ID: 40030354
glad I could be of assistance.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Viewers will learn how the fundamental information of how to create a table.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

650 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