473,396 Members | 1,996 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,396 software developers and data experts.

DayOfWeek

Hi I am trying to get dayofweek for the given date.

Dim d As Date

d = DateTime.Now

when I tried d.dayofweek, it gave an error. Is there some reference I need to add??
Sep 30 '07 #1
5 4942
QVeen72
1,445 Expert 1GB
Hi,

Dim TDay As String

TDay = d.dayofweek.ToString

Regards
Veena
Sep 30 '07 #2
I tried the following
Dim d As Date
Dim str1 As String

d = DateTime.Now

str1 = d.dayofweek.ToString
'str1 = CStr(DateTime.Now.dayofweek)

MsgBox str1

when I use
str1 = d.dayofweek.ToString I get "invalid qualifier" and 'd' is highlighted.
When I use
str1 = CStr(DateTime.Now.dayofweek)
it gives an error "Object Required"

basically dayofweek is not working for me
Is there a dayofweek in VB6???
Sep 30 '07 #3
Killer42
8,435 Expert 8TB
In VB6 you would use the Format() function on a date field. There are parameters to return the full or abbreviated day name. Here's one sample from the doco...

MyStr = Format(MyDate, "dddd, mmm d yyyy") ' Returns "Wednesday, Jan 27 1993".

Which gives you some idea how old the doco is. :)
Oct 1 '07 #4
QVeen72
1,445 Expert 1GB
Hi,

As Killer suggested:

Format(DATE,"DDDD")
Will give you Today's Week day.
I thought you were using VB.Net and gave you that syntax..

REgards
Veena
Oct 1 '07 #5
Hey thanks a lot guys you are really great help :-)
Oct 1 '07 #6

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

Similar topics

1
by: Gary Brewer | last post by:
Why did Microsoft decide to start the DateTime.DayOfWeek enumeration with Sunday and ending on Saturday. I thought that a week began on Monday rather than Sunday? Or is this an age old unresolved...
3
by: Gerben van Loon | last post by:
Hi there, hope someone can help me on this: DateTime.Now.DayOfWeek is always returning the american day names like "Monday, Saturday". Even when my CurrentCulture is set to my localized culture....
4
by: M | last post by:
Hello, I have code like dt.DayOfWeek.ToString(CultureInfo.CurrentCulture) where dt is a DateTime object. I get something like "Sunday", "Monday", etc... while I'm expecting it to be in...
8
by: simon | last post by:
dateTime sellDate; int16 dayOfWeek; dayOfWeek=sellDate.DayOfWeek I would like to set that monday is the first day of a week and not sunday. Any idea? In VB there is a function, where you...
0
by: Harry Haller | last post by:
The context is shown below in the getGames() method. I get errors on these lines: dtGames.Rows = (TimeSpan)dtGames.Rows; dtGames.Rows = (DayOfWeek)dtGames.Rows; because the playDate column...
5
by: What-a-Tool | last post by:
Have a group of dynamically created text boxes in a calendar like grid. At the head of each column, the textbox is to contain the day of the week. Now I am using a Select Case statement to...
16
by: pankaj_wolfhunter | last post by:
Greetings, In DB2, we have dayofweek function that returns a numeric value for the current day (1 for sunday till 7 for saturday) Is it possible to alter this function value, i mean 1 for monday...
3
by: Charlie Brown | last post by:
I am trying to cast a string to System.DayOfWeek. Don't even know if this is possible but it would sure save me a lot of headache if it is. Trying... Dim strDay As String = "Wednesday" Dim...
2
by: David P. Donahue | last post by:
Probably a simple question: I have a function that receives as an argument a DateTime value. One of the things I want to do is check to see if it's a weekday. So I do the following (sorry for...
5
by: Brian S. | last post by:
Hi, I am trying to calculate the number of DayOfWeek in a month.. for instance.. this month April I want to know how many tuesdays there are in this month, this year I try to use where intDOW =...
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?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.