Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends
I have a problem that i want to data between Two date .on sunday holiday.even though i get sunday Date in my Records..

Ex
IF i entered 1-1-2013 and 31-1-2013
it shows Record as

1-1-2013
2-1-2013
3-1-2013
...
...
...
...
...
...
...
...
31-1-2013
Posted
Comments
Ankur\m/ 30-Jan-13 6:39am    
So do you not need weekends (or specific day in your result)? how would Sql know that. You must write the condition in your query. Show us your query and we might be able to help with your issue.

1 solution

So what exactly the issue? you given 1-1-2013 and 31-1-2013 and its giving the data.

Also spcify where you are fetching data ? SQL? If yes, you may have to use correct operator. For example

SQL
select * from table1
where 
date < endDate and
date > startDate


Hope that helps
Milind
 
Share this answer
 
Comments
Ankur\m/ 30-Jan-13 6:40am    
Your answer seems more like a comment to me.
hardy panchal 31-Jan-13 1:09am    
actually sir i Did the same thing bust still it get record that it inserted on that dat not all date
MT_ 31-Jan-13 1:10am    
as everyone said, show your code i.e. SP , you may remove/modify if there is any sensitive information.
hardy panchal 31-Jan-13 1:34am    
ALTER PROCEDURE [dbo].[GetDaillyAttendanceReport]

@FDate DateTime =null,
@TDate DateTime =null
AS
BEGIN
select
D.*
(case when (Presence='P') then 'P' when (Presence='A') then 'A' else '' end)as Att
from Usp_Getdate('01-01-2013','01-31-2013') a
left Join DailyAttandanceEntryMaster as D on a.date=D.date

where (@EmpID is null Or @EmpID=0 or D.EmpID=@EmpID)

And (D.Date Between @FDate and @TDate) Order by D.Date

Usp_GetDate is Function For get All Date and compare it with DailyAttendanceMaster...bt it get only match date data not all Date
MT_ 31-Jan-13 1:44am    
so it is getting data of 01-Jan-2013 and 31-Jan-2013 only? And you want all 31 days data. Is that right understanding? If yes, need to see USP_GetDate function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900