473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Using datepart to set the first day of the week

1
I am trying to use datepart to to set the first day of the week as Thursday. Problem is I have looked at the examples of the code and I can not seem to figure out what I need to type to make it work. I have 0 experience when it comes to VB coding so I normally try and find an example of what I want and simply copy and paste it but I have not been able to find an example. Can someone spell out the datepart function for me so I can try and make this work?
Mar 16 '10 #1
1 3098
ADezii
8,834 Expert 8TB
The FirstDayOfWeek Arugument has relevance only for the w (Weekday) and ww (Week) Intervals. A couple of examples, with Output, based on the Current Date (3/16/2010) and Weekday Interval, are:
Expand|Select|Wrap|Line Numbers
  1. ? DatePart("w",#3/16/2010#,vbTuesday,vbFirstJan1)
  2.  1   
  3.  
  4. ? DatePart("w",#3/16/2010#,vbWednesday,vbFirstJan1) 
  5.  7 
  6.  
  7. ? DatePart("w",#3/16/2010#,vbThursday,vbFirstJan1) 
  8.  6 
  9.  
  10. ? DatePart("w",#3/16/2010#,vbMonday,vbFirstJan1) 
  11.  2 
Look at the the Help File for complete details on its use.
Mar 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David | last post by:
Hi Group, i am trying to use the DatePart function on my SQL2000 database. I have a table called visitors with a field called DateTimeEntrance which is filled everytime a visitor enters the site....
3
by: Chumley the Walrus | last post by:
I'm trying to use DatePart and Datediff functions to show the formatted m/dd/yyyy display for the dates of Monday and Friday of the current week. I want it to display as: Our Weekly Schedule...
2
by: Alicia | last post by:
Hi, I am trying to group by week and do a count of my data in between the dates. In Microsoft Access. Something similar to Before: Date Count --------- ---------...
3
by: haydn_llewellyn | last post by:
Hi, My company runs on a fiscal calendar that starts on the first monday in July, and is based on a 13 week quarter (4 weeks, 4 weeks, 5 weeks). What I need, is a way of relating Date() to the...
1
by: Ryan Ternier | last post by:
I'm trying to find an equivilent function to VB's DatePart function. I have a Year, Month, the Day of week (Sunday, monday etc.) and the week (week 1, week 2) and I need to find the date of that...
3
by: LIN | last post by:
Hi, I have dataset which contains the data like this TranDate PurchaseVal ------------ ------------- 2003-01-01 51 2003-01-02 52 2003-01-03 ...
3
by: S. van Beek | last post by:
Dear reader, With DatePart() you can subtract the year or the week from a date field with: DatePart("yyyy";) for the year
9
by: Cliff | last post by:
I want to use the Datepart function to determine the week number based on my company's fiscal calendar which starts Nov. 1. I have tried the following and they all produce #ERROR# . ...
4
by: eavery | last post by:
I can't seem to find a way to do the following: create table part_table ( col1 int, col2 datetime ) on psX (datename(week,col2)) I want to partition based on the week number of a date field....
3
by: devagupt | last post by:
Hello , I have a query which adds all the downtime for a given week and displays it. All i have to do is , is to type the week number and it shows be the data. However we have rolled into the new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.