Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Determining Current Week


Is there an easy way to determine on what Day a specific week starts and ends on. eg, I have an application that contains the week #, I want to display on the Screen Week 14 - 04/01/2002 - 04/07/2002.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Determining Week Of Year
Hi,

The DTP control appears not to have a property for week of year! Am I missing something??

Best regards,
AstroTux.

Determining What Week A Date Falls In
I have a small program that I am creating that will prompt the user to enter a date in the format mm/dd/yyyy. Is there anything built in VB that will allow me to find out which week of the year the day falls in. Im assuming that VB assumes that Sunday is the start of the week.

An example of what I am trying to do would be the following.

The user enters the date 01/05/2006. And the program would know that the date entered is in Week 1 of the year. I am trying to get this so that it will work moving onward for any year in the future.

Any ideas or starting points on where to begin with this.

Thanks

Getting Current Week *RESOLVED*
Hey everyone. I trying to get the current week but I'm stuck now. Here is what I have so far.



VB Code:
Dim dTheDate As Date  Dim nWeek As IntegerDim dStartDate As DateDim lDays As LongDim lWeek As Long  TheDate = DatedStartDate = "01/01/" & Year(Date)nWeek = DatePart("ww", dTheDate)lDays = lWeek * 7MsgBox dStartDate + lDays


So it returns 18 and I try multiplying 7 to get the total days since 01/01/2003 and then add that to 01/01/2003 but I keep getting 05/07/2003. If someone can help me I would greatly appreciate it.

How Do I Find That The Current Day(15) Comes Under 2nd Week...
Hi Guys,

how do I get which week is the current day.
i.e. 15th of Oct is falls under 2nd week. I want the no 2
to be the output.
Is there any code for that ?

Thanks
Premal

How To Find The Current Year And Week In Sql?
Hi,
I have a Serial No which has a length as 14.For eg IL010730123456. IL01 is The Default Code. 07 is the current year and 30 is the week of the year. 123456 is Serial. How shoud I find The Year and week with the help of this serial no ie The First day of the 30th week of 2007.Is it Possible?

Plz Help me with an Sample Code .
Thanks.....

Test If A Date Is In The Current Week
I'm trying to make a little function that checks if the date in the database is in the current week and then if it is, I could add the entry on a listview.

Here's a concrete example of what I'm trying to do:
Let's say an entry has the date May 8th 2007. I want to test if Now is in the same week as the entry. (Now could be a date from May 8th to May 12th (can't go in the past naturally)).

Weeks start on monday too.

I've tried a lot of things to make it works, but I still didn't succeed, that's why I'm asking you guys...

If someone could help me with this I would really appreciate it.

Thanks in advance.

Number Of The Week Of The Current Year?
Hello, does anyone knows a easy way to get the number of the week of the current year?

btw, this would be to use in a vbscript if that matters in the case

Determining If Previous Row Is Equal To Current Row In A Recordset?
hi, i'm just wonder if there is a 'quick and easy way' to determine if previous row is equal to current row in a recordset?
I will not know the field number at run time, so if i was going to just make some temporary 'compare' values then i'd have to redetermine an array every loop of the recordset.

thanks

Determining Current System Mouse Cursor(s)
I am using (more or less) the code example linked below to retrieve the current cursor, and set a new one:

http://www.vb-helper.com/howto_set_system_cursor.html

The problem is that the GetCursor method (required for NT) is somewhat flawed imo. I need to change the arrow, hourglass and arrow+hourglass cursors, which means I need to 'get' each one of these initially before changing them. In theory I should be able to just set my forms MousePointer to each one in turn, use GetCursor to obtain the current system cursor, and then change it back when my program quits...

However in practice I cannot get this to consistently work. I believe the problem is that when my app is launched, the cursor is probably the AppStarting (arrow+hourglass) or Busy (hourglass) one. This means that my changing the forms MousePointer doesn't really have an affect. While I could possibly get around this by adding a delay, this also would probably be hit and miss (since loading/busy times will vary on different systems).

My idea is this: Since the LoadCursorFromFile API works flawlessly, I would like to be able to determine the filenames of the system cursors when my app starts, so I could just LoadCursorFromFile the original cursors when my app quits. The flaw in this plan is that I think the Windows Default cursors may be embedded somewhere rather than separate .cur files (I cannot find the system default cursors in windowscursors, or anywhere else).

Can anyone tell me:

a) are Windows Default cursors embedded (rather than .cur files)?

b) if the answer to the above is no, or if non-standard cursors are used, is there a way to determine the cursors filenames?

Sorry for the long text...thanks

Determining Current Version Of Crystal Reports
I'm developing a small diagnostics tool in VB 6.0 to help me determine the existance of certain software on a machine and their versions (After finding out if they're installed). But now I'm having a small problem in finding a solid way to do this for Crystal Reports, any comments or suggestions would be helpful

Thanks in advance

-GLantz

Determining Wether Current Cell/range Within A Specified Range
Hi,
I am trying to write a macro for excel spreadsheet.
I am trying to find some function or method to determine wether a particular cell is currently within the specified range or not.

A simple example to illustrate question:

Dim Action_Range as Range
Set Action_Range = Range("A1:H:10")

Dim Current_Range as Range
Set Current_Range = ActiveCell

If Current_Range is part of the Action Range then
'do something
Else
'ignore
End if

Can somebody give some suggestions?
Thanks

Access Report GroupOn = Week; How To Set MONDAY As The Beginning Of Week For Reporting.
Newbie here....

I need to create MS Access reports that use Monday as the beginning of the
work week where the data is grouped by week. I haven't found any code or
setting examples for Queries where I can do this. Any ideas?

Thanks in advance!

Determining Current "Quarter"...
I need to know the best way to get the current quarter date range based on current month...

I am filling an excel sheet...

one section is current quarter..
so if its June
I need to add April, May , June
if its July... then just add July...
the months are in an array (which is current month to current month -12)

auugh! my brain hurts trying to figure this out...
So if its June, I need to add values to a range in excel
April, May, June (for column headers)

I hope I have explained this well.. probably not since my brain is all over trying to figure this out.


[EDIT]: No im wrong!!
I will need to know what 1, 2, or 3 months to add together!! not fill out cells.. omg this sucks!

Find Week Start Date From The Week Number
Does anyone know a way to find the start of the week from a given week number?

For example we are in week 32 this year and the start date is 2/08/04.

I have used the following to find the week number:


Code:
Private Sub getWeekNumber()
'This fantastic bit of code returns the week number

Dim iNumberOfTheWeek As Integer

iNumberOfTheWeek = DatePart("ww", Now())

End Sub

But now I want to find the date range that any given week covers.

Any ideas?

How To Get The Week Of A Particular Month And Then Search For The Date In That Week?
Hey guys, I have a problem here. I am at da moment, trying to code the form where I can calculate the week's Statistics of the booked dates in the file.

All Im tryin to do is the user has access to the months 1 - 12 after he clicks on the combo box. after that he can choose the first second or last week from another combo box after this he will be shown the no: of bookings done in that week.

I cant get it working. I got it to 2 work on the month and week by adding them to da combo. but not the process.

please help

Darkshade

Week Number And Week Ending Date In VB 6
Hi,
I'm trying to get the system's week number and its week ending date using the VB FORMAT function. For the week number is pretty simple and it works fine but its week ending date I can't find the function. It has to be a function for this instead of codes.

For my week number is this:


test1 = format (date, "ww") 'it gives me the current week number (numbers from 1 to 52)


Now from that week number I would like to get the week date ending, eg.

for week 19 its ending date would be 05/10/2003 (Saturday May 10, 2003)


Any ideas?


Thank you

Olivia

Week Numbers && Week Days
I have a project where I need to find the week number ( say Jan 1st to Jan 6th is Week#1, Jan 7th to Jan 13th is Week#2)

also How can I find the day of the week, How do I find whether Jan 1st is Monday or Sunday.

Anybody ?

Date Of First Day Of The Week From A Week Number
Does anyone know of a way to get the date for the first or last (It really doesn't matter) day a week given a week number?
I'm calculating the week number by using:


VB Code:
lcurrentweek = format(Now, "ww")lcurrentweek + 1...lcurrentweek + 9 'Then i'd like to find the first or last day of each of those  


I guess since I'm just trying to get the first dates of the next nine weeks that i could just find the first date of this week and keep adding seven too it?

Thanks
Andy

Finding The Date Of The 2nd Day Of The Week Of Week 44
how can i find the above?

e.g i want to find for weeknumber 44 what is the date of monday

thnks

Current Position On Current Line *resolved- Code I Used Inside*
this is for VBA but i dont think it will matter if you know a way to do this in VB6 that would be great i will try to convert it from there on my own thanks

ok my question is that i have a textbox on a worksheet in excel and i want to be able to find out what the current position on the current line that im on. here is what im trying to do. ok i am first off converting a file from a emacs file to beable to be read and looked at in windows. and the tab stops to look right in windows. in emacs it make the tabs 8 spaces long and for some reason they are only like 5-6 or so in the textbox. and i want to beable to take a chr(9) which is tab and replace it with space(8) but here is where the problem is.

when you are in the first space on a line it and hit tab in emacs it moves over 8. then of you are on the 2nd it moves over 7 and goes to the same spot as the last tab this happens all the way over to space 8 where it starts over. and i need to be able to detect want spot the chr(9) was found on so i know how many spaces to go over. well hopefully someone can help. i currently dont have any code writen really. all i have is the code the replaces all chr(9) with space(8) if you want i can post that so you can look at how i do stuff.

well thanks for your help and hope you read this soon thanks

Get Current Month On Current System Language?[SOLVED]
Hi.Is there a way to msgbox the current month but on system language?This : [vb]msgbox Format$(Date, "Long Date")[/vb] would msgbox date, date num. etc in your own language but I only want to msgbox the month.

So how can i do this?

Thanks

Finding The Current X && Current Y Of The Mouse Pointer.
Is there a cursor object or a mousepointer object thats hidden in some obscure library?

For some reason I can't figure the X,Y position of the mouse - unless i'm dragging another object.

Any help?

-Kedaeus-

Current Drive Instead Of Current Directory
Hey again everyone !

Simple on this time....

I need the current drive of the running app. I can get the currnet directory by the following:

dim curdir as string

but...can I want just the drive letter.... can I do this without string manipulation ??

thanks again !

Get The Current Procedure Name, Current Form Name . . .
I want to get the name of the:
- current project
- current form
- current module
- current function
- current procedure or method.
where I am working


How can I do to get it?

thanks and regards

How To Get The Current Directory And Current Drive In VB6.0
I just want to know how and which function to use to get the current directory and current drive in VB6.0

How To Get Week Day Name
Is there any function in VB that gives me the day of the week like Sunday, Monday , Saturday etc. when I pass any date (mm-dd-yyyy format) in the function.

Week Day
I'm trying to get a label to display the current week day using a timer. ex: monday.

i know label1.caption = time for the current time, label1.caption = date for the current date, but its in 6/21/02 format and i need Monday format

Day Of Week..
I am modifying a application that enters in our timesheets here at work. What I want to do is determine if the entry is for a week day, or a week end. The entries were entered as "1/2/02" format, so I changed them to the "Long Date" format, Saturday, January 2, 2002" At least it displays in Access like that. But when I do my query in VB, i pulls it as 1/2/02. What I want to do, is pull the Saturday part of the date? Any idea on how to do this?

The First Day Of A Week
Sorry if it seems that I havent looked around the forum for this answer already, its just that the words "day" & "of" are too small for the pesky search facility!!!

Anyways down to my problem. I wold like to figure out the first day in a week. I.e. if i specify the date 09/02/2005 it will tell me that the first day of the week is the 6th.

Any thoughts??

Lucas

Day Of Week
Is there a function similar to MonthName() to get the day of the week? I know there is WeekDay which returns a numeric number but i've already got the numeric number and I want to now get the day of the week. eg 1 would return Monday, 2 would return Tuesday.....

Get Day Of The Week From Day?
Hi.

Is there a function to return what day of the week it is if I give it a day?

GetDay("April",12,2008) would return "Saturday"

Is there such a function, how would I go about making one if there isn't?

Thanks.

Day Of The Week
I have a spreadsheet with a column of dates in dd/mm/yyyy format.

I need to write a forumla so that if the day is Monday, Tuesday, Wednesday or Thursday i will add £40 to the cost. If the day is Friday, Saturday or SUnday i will add £90 to the job.

eg. How can i get excel to recognise that 16/05/2007 is a wednesday, then charge £40.

any help is appreciated.

thanks in advance

Want Week Day
I want to use week day I am using following code

vb code:
day(now)

I could not get the right answer it return digital value.I need Monday tuseday,wednesday.

I also use the code

text=format(now,"ddd")
it returns "mon,tue,wed"

Please tell me how can i get the full name like Monday ,tuesday,wednesday

Get Day Of Week.
How can I get the day of the week like Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday

1 Week Later - Still Can't Do It
Can someone please help!

Using VB6

Has anyone used the Data Environment and the Report Builder to open a report.

Please, please please help!!!!!!!!!!!!!!!!!!

First Day Of The First Week
How do I become the first day of the first week from a year ??
( This year it is Sunday, 30-12-2001 )

Day Of The Week
How do i find out from VB which day of the week is it ??

How Can Get The Day Of The Week?
How can i get the day of the week?
I mean, i want to know if the current day is , Saturday, Sunday, Monday....



Thanks in advance!!

Day Of The Week
Is there an "easy" way to consistantly determine the day of te week (Mon, Tue, Wed). There wouldn't happen to be a variable out there that carries it, like Date and Time do?

Thanks in advance

Day Of Week
Can anybody please tell me how i can find out what day of the week its is from a date string.
Thanks

dave

Day Of The Week?
Hello...

Thanks for all the help on my previous questions...

I am trying to figure out what day of the week it is according to system time.

Is there a simple function that does this?

Thanks,
Scott

First Day Of The Week
I will fill in a weeknumber and i must receive the date of the first day of this week.
for example:
I type week 46 and he returns me 15/11/99

How can i do that?

Thanks

Getting Day Of Week
Does anyone have a VB function that returns the day of the week given a formatted date?

Week No
Hi

Does anyone have a code snippet for displaying the current week no in a text box

Many thanks

Rob

Day Of The Week
hi guys

i am getting a date from my sqlserver database, i need to get the day of the week for that particular date. does anyone have any ideas

thnx

Evb : Get Day Of A Week
hi,

I am able to get today date by the following.

Dim myDate as Date
myDate = Now

But I want to get the day of the week, like Monday, Tuesday or Wednesday.

I don't know how to do it.
Please teach me. Thanks alot.

Current Form, Current Sub
Hello

I want to right a generic error handler for my app. When an error occurs, a msgboc popups with the error number, error message. I would like the message to contain the current form or module that caused the errors and the current sub/function would be sweet also.

Me.Name work for forms, but not for modules.
no idea how to fetch the current sub.

thx

Current Row And Current Cell
Best wishes for the year 2002 from belgium.

How to get the current row and current cell within
a datagrid when the user double click on a row or cell?




thanx
Ray

The Day Of The Week Corresponding To A Date
Hey. I'm sure this is easily done, but if I get a month and a year, how could I be able to figure out which day the first of said month fell on? For example, if I were to receive November, 2006, I'd want to know that Novumber 1st falls on a Wednesday.

Copyright © 2005-08 www.BigResource.com, All rights reserved