.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Week no

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :ASP.Net

I have to find the no of the week, dies anyone know a way to capture the week no Ex:

I use 



datepart(wk, '2010-07-29') - 26 AS 'Current Date'



View Complete Post

More Related Resource Links

dropdownbox which selects records based on criteria (TODAY, THIS WEEK, THIS MONTH, etc)


I have a dropdownbox which I want to use to search records based on a timescale. The gridview populates results based from that search.

So here is how I want to work this;

If a user selects "today" - a list of records input today are populated. If "this week" is selected, a list of all records added within that week from todays date is populated.

I created a forum on this issue previously but to no avail whatsoever. How do I work around this problem?

Help would be much appreciated

SSAS Calendar Week commencing with split at month

Hi all, Wonder if someone can help. Our CFO wants to see a cube calendar that shows week commencing but stops at the end of month. For example if the dates are Monday  28th   Tuesday  29th   Wednesday 30th   Thursday 1st    Friday  2nd Saturday 3rd Sunday   4th So for this example the week commencing is the 28th of Month 1 and Thursday is week commencing 1st of the next. I am having a problem seeing how I can do this. If I add the weeks to a standard calendar I get the week commencing 28th which includes the 7 days, naturally. I cannot help feeling I am missing something obvious. Cheers

Is there a way to disable the day and week links within the Calendar itself?

I'm able to hide the top icons. I'm wondering if there's a way to keep a user from clicking the top of a date or the side of the week and navigating them to another calendar view. I only want to keep them within the month view. Thanks in advance! -Mike

Grouping by week, but show day range

SELECT SUM(T.SPEED_OCCURRENCES) AS TOTAL_SPEED_OCCURRENCES, CONVERT(NVARCHAR, DATEPART(WEEK, T.DATE), 101) AS STRDATE FROM VEHICLE_TRENDS T, @VIEWABLE V WHERE T.VEHICLE_ID = V.VEHICLE_ID AND T.DATE BETWEEN @START_DATE AND DATEADD(DAY, 1, @END_DATE) GROUP BY DATEPART(WEEK, T.DATE) ORDER BY [STRDATE] ASC; So we have a query that returns results like: TOTAL_SPEED_OCCURRENCES       STRDATE 34                                               34 45                                               35 67                                               36 Where STRDATE is the week number. This is correct grouping, but we want STRDATE to select the range of day

How I select Start of week is Friday from date of Year ?

Hello everyone, I am tring to solve How i select Start date is Friday from week? Details for which i want to show I have dtmDate column in a query. from that date i display week of that date as per using (ww,dtmDate) as dtmWeek, and parameters are StartDate & EndDate Suppose I select StartDate as 1/1/2007 & End Date as 12/31/2007   I  do not want to show Output as: Weeks                      Column1          Column2 1/1/2007 (Thuesday)       5                     6 1/2/2007 (Wed)               4                     2 | | 1/5/2007  (Friday)            1                      8 1/6/2007 (Saturday)        7                     

MDX Query - Find only new item that purchased in the last day or during the last week

Hi to all I whould like to write a MDX query to get new items that purchased in the last day and not purchased in the last 7 days or 30 days  , Also to find new items that purchased in the last 7 days and not purchased in the last 30 days , this is what i done until now CREATE   SET CURRENTCUBE.[FindNewWordIn_1_Day]   AS Filter   (nonempty([Keyword].[Keyword Name].members, ([Measures].[Count keyword],   NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS ,   Not IsEmpty ([Measures].[Count keyword]) ), 1) ))) ,([Measures].[Count keyword], [Time].[Date].&[2010-09-10] )=0);   The value of [Time].[Date].&[2010-09-10] should be change to period that i want to check , ( 1 day, 7 day , 30 day)   the other one is lateset day with value NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS , Not IsEmpty ([Measures].[Count keyword]) ), 1) with for you help ,   ofer  

SQL WEEK function

Does SQL 2005 have a week function? If not how can I find the week in a SQL SP.   Thanks!!! 

YEAR --WEEK of the YEAR -- DAY of the WEEK to datetime

Good Evening Can someone help me covert a string in the format YEAR --WEEK of the YEAR(1-53)  -- DAY of the WEEK(1-7)to datetime ie 2010-38-6 is today = '2010-09-17'  valid sql server date nb day numbers are 1 to 7, 1= sunday thanks   David          

logic for Custom Start Day and End Day for a week.


Hi All,

We have a unique requirment where we have our own start day of a week and end day of a week(C#),

Contrary to the existing Date Time class whose start day is Sunday and end day is Saturday, we have Wednesday as our start day and Monday as our EndDay (and this will vary per client).

and we need to implement the following logic

a) for a given date get the start Date of a week and end Date of a week

Ex: based on the above if the current day is  23/Sep/2010 (Thur) we need to get  22/Sep/2010 (Wed) as our Start Day and 27/Sep/2010 (Mon) as our end day


Can anyone help here?




How to schedule the custom timer job two times a week to run in MOSS




I have scheduled a custom timer job to run for weekly two times using the spschedule. the string used in the feature event was

"weekly between tue 23:00:00 and thu 23:00:00"

But the problem is i have the job is running only once with the above schedule.How can i run the job twice a week on specific days.


Please share your ideas/solutions to run the custom timer job in  MOSS as per the above schedule.






Thanks keshav,Share point Developer

Last day of month and last day of the week Using MTD,YTD

How Can I achive Last day of month and last day of the week Using MTD,YTD function in SSAS Qube ?

select records within a week


i try to use select statement to select records within a week from orderdate. like,


"select * from order where orderdate <= DATEADD(day,7,orderdate)";


correct me if wrong.


Week/Day View in asp.net


how to create week view,day view in asp.net

TSQL to get Week of Day


Hi all,

I need to write a automatic query. Please see below for example.

Date: 4/4/2010 (Monday), 4/5/2010 (Tuesday), 4/6/2010 (Wednesday)

So from every Monday - Sunday (End of the week) the result = Week of October 4th 2010

Date       Day          Wanted Result

4/4/2010 Mon          Week of Oct 4 2010

4/5/2010 Tue          Week of Oct 4 2010

4/6/2010 Wed         Week of Oct 4 2010

4/7/2010 Thur         Week of Oct 4 2010

4/8/2010 Fri            Week of Oct 4 2010

4/9/2010 Sat           Week of Oct 4 2010

4/10/2010 Sun         Week of Oct 4 2010

4/11/2010 Mon         Week of Oct 11 2010


Thanks loadzzz in advancee

Calendar List View Issue - No Month, Week, Day Icons


I'm trying to setup a Calendar view for a list in SharePoint 2010. Everything is working the way I want, except there are no icons to change the view from Month, Week, or Day. Right now, if someone clicks on a date on the calendar, it switches to the Day view. But there is no way for them to go back to the month view.

I open the page in SharePoint Designer, and in the Design view I can see three icons on the Calendar (Month, Week, Day). But at no time do these icons show up anywhere except the design view.

I want it to have the arrow buttons, the month and year (which are already displaying) and then the icons to change the view. How do I get them to appear?

How to retreive week number in SSRS


How to retreive week number in SSRS if i have date 09/25/2010 in Expression



Find no of employees who are getting week off in same day.


 Hi All,


      This is my table with employees data.Right now i gave only 1 employee data of 4 weeks.

How to find whether the employee is getting weekoff in the same day for all 4 weeks,3 weeks 2 weeks.similarly other employees and return count.

For example if the employee is getting weekOff on saturday for all 4 weeks then we can count it as 1.
I want reports like this.

Some employee may get weekOff for 2 days consistenly for 4 weeks say Saturday and SUnday then that result should be display in 3rd row.

If the employee is getting weekOff on saturday for last 3 weeks and 4th week on sunday then we should add count in 3weeks column i.e 2 row 3rd column.In 4th week column it will be 0.

ConsistencyOff Across4weeks 3weeks 2weeks
0 2% 2% 2%
1 98% 98% 98%
2 0% 0% 0%

empno int,
MatchingOff varchar(10),
atnDate datetime


Insert into TestTable(empno,MatchingOff,atnDate)
select '101','Off','8/1/2010' union all
select '101','16:00','8/2/2010' union all
select '101','14:00','8/3/2010' union all
select '101','17:00','8/4/2010' union all

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend