473,326 Members | 2,168 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,326 software developers and data experts.

Converting dates

50
Hi guys

I have a report which auto groups my daily results into weeks by week number:

=Format$([OrderDate],"ww",0,0)

...Any ideas how I can introduce a column that would state 'Week Commencing Date' for each week???

Thanks in advance, OllyJ
Apr 29 '08 #1
1 969
MikeTheBike
639 Expert 512MB
Hi guys

I have a report which auto groups my daily results into weeks by week number:

=Format$([OrderDate],"ww",0,0)

...Any ideas how I can introduce a column that would state 'Week Commencing Date' for each week???

Thanks in advance, OllyJ
Hi

Something like this
Expand|Select|Wrap|Line Numbers
  1. Dim YourDate As Date
  2.     YourDate = Date
  3.  
  4.     MsgBox "Week Commencing Monday " & YourDate - (Weekday(YourDate, vbMonday) - 1)
If you want week commencing on any other day just change vbMonday constant to suit.

??


MTB
Apr 29 '08 #2

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

Similar topics

6
by: Kit | last post by:
Howdy! I have some dates in a MySQL database that are in a 'Y-m-d' format. Is there a way to have PHP read these dates and convert them to a 'd-M-Y' format?
0
by: Massimo Fiorentino | last post by:
Hello there! I am a bit of a newbee into the mySQL world and I have a question regarding switching from one DB to another. I have for a couple of years used a very simple CMS-system created by...
6
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this...
3
by: Scott Kinney | last post by:
I have a database that I imported from a csv file (I know, all the stories start out this way...) The dates were given as text strings of the form 'yyyymmdd', and were imported as text. Not all...
7
by: Dana Shields | last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert my queries to SQL Server views; however, I'm having a lot of difficulty with the syntax differences. For instance, a...
12
by: Vincent Delporte | last post by:
Hello My site is hosted on a server in the US, hence set up to use the mm/dd/yyyy date format instead of the European dd/mm/yyyy. Also, MySQL stores dates as yyyy-mm-dd, so I need to convert...
3
by: zshenk | last post by:
I need help converting dates. Currently, I have several tables and databases that use the format 1/20/2007. I have a table right now that uses the 20070120 format, and I was hoping that someone...
21
by: py_genetic | last post by:
Hello, I'm importing large text files of data using csv. I would like to add some more auto sensing abilities. I'm considing sampling the data file and doing some fuzzy logic scoring on the...
5
by: wespw1 | last post by:
I have a form where I have 2 dates: 06/27/2007 01/28/1996 What I need to get is the difference between the 2 dates in months. Or in otherwords I am trying to get the age of the 2 dates in...
11
by: Keith Hughitt | last post by:
Hi, I am having a little trouble figuring out how to convert a python datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a UTC date so that when I send it to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.