15,896,118 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by akhter86 (Top 62 by date)
akhter86
15-Nov-23 12:10pm
View
@Gerry Schmitz i already used debit and credit field ,i did not understand you,( easiest way to avoid brain fog)
akhter86
7-Nov-23 4:13am
View
ok i try it ,let you know
akhter86
7-Nov-23 3:36am
View
Server side code ,its fine.so where need to do changes on client side
public ActionResult UpdateCustomer(CustomerMV customer)
{
{
Customer updatedCustomer = (from c in DB.Customers
where c.CustomerId == customer.CustomerId
select c).FirstOrDefault();
updatedCustomer.CustomerId = customer.CustomerId;
updatedCustomer.Name = customer.Name;
updatedCustomer.Country = customer.Country;
updatedCustomer.UserID = customer.UserID;
DB.SaveChanges();
}
return new EmptyResult();
}
akhter86
7-Nov-23 3:19am
View
Browsing console display below error
Duplicate form field id in the same form
Multiple form field elements in the same form have the same id attribute value. This might prevent the browser from correctly autofilling the form.
To fix this issue, use unique id attribute values for each form field.
akhter86
7-Nov-23 2:55am
View
there is not error in code,i am facing issue to update value from dropdown list to database,which is not updating
akhter86
21-Feb-22 14:43pm
View
i did as you told ,but not getting expected output
akhter86
21-Feb-22 14:21pm
View
No ,it will just filter data from containerno table
akhter86
21-Feb-22 4:00am
View
Order by Entrydate
akhter86
21-Feb-22 3:58am
View
why your query eliminating this record (1003,2,1,500,'2022-02-01',null) ,it inserted into conIssuance on date 01/02/2022 ,it must be part of from 01/02/2022 to 15/02/20222.
Second thing Closing is not getting carry forwarding for the next day date opening as per date parameter.
akhter86
4-Dec-20 11:46am
View
thanks ....
akhter86
4-Dec-20 9:01am
View
i do not want to repeat inv_ID,as your provided query ,is repeating Inv_Id
akhter86
30-Aug-20 7:49am
View
hi OrigingalGriff,
Currently query which i provided above,is fetching that employee which asd.sal_Id is null,
I tried to use different join,but result which is i am expecting is not coming.
THere is no any error messaage
I am stuck ,that my expecting result is not coming.
I need help to retrieve all employees ,with condition of asd.sal_id is null
akhter86
30-Aug-20 5:46am
View
i tried below query ,many time modify
SELECT (M.Emp_ID) , M.EMp_Name , M.EMP_Salary ,D.Designation_Name as Designation,
SUM(CASE T.DA_Name WHEN 'Loan' THEN (ASD.assign_amt)ELSE 0 END) Loan,
SUM(CASE T.DA_Name WHEN 'Advance' THEN (ASD.assign_amt)ELSE 0 END) Advance,
SUM(CASE T.DA_Name WHEN 'Mobile' THEN (ASD.assign_amt)ELSE 0 END) Mobile,
SUM(CASE T.DA_Name WHEN 'Conveyance' THEN (ASD.assign_amt)ELSE 0 END) Conveyance,
SUM(CASE T.DA_Name WHEN 'Medical' THEN (ASD.assign_amt)ELSE 0 END) Medical,
SUM(CASE T.DA_Name WHEN 'Rent' THEN (ASD.assign_amt)ELSE 0 END) House_Rent,
isnull(M.emp_OT,0) as emp_OT
,0 'txtpresent', 0 'txtabsent',0 'txtsalary',0 'lbOT_Amount',0'txthour',asd.Sal_ID
FROM #tbl_Employee_Master M
inner join #tbl_designation D on D.Designation_ID=M.Designation_ID
left join #tbl_assign_Allowance_Deduction ASD on asd.Emp_ID=M.Emp_ID
left outer join #tbl_Type_allowance_Deduction T on T.DA_ID=ASD.DA_ID
where asd.sal_ID is null
group by M.Emp_ID,M.EMp_Name,M.EMP_Salary,D.Designation_Name,M.emp_OT,asd.Sal_ID
akhter86
8-Jun-20 23:17pm
View
i check my whole code,
akhter86
8-Jun-20 6:32am
View
I check debug ,code is executing but no changes is done
akhter86
8-Jun-20 5:27am
View
Means that textbox is not getting enable false
akhter86
19-Jul-19 10:56am
View
so what is the best practice
akhter86
14-Jul-19 7:54am
View
?
akhter86
14-Jul-19 7:25am
View
for avoid to duplicating
akhter86
3-Jul-19 1:18am
View
is this way? but still same issue
( Select (ISNULL(Small_Bale_weight,0))/(ISNULL(SELECT SUM(val)
FROM (VALUES (Bigbale_Weight),
(Small_Bale_weight ))AS value(val)
))*100.0,0)) as Percentage,
akhter86
27-Jun-19 3:38am
View
here is my desired result https://ibb.co/Jz98hwh
akhter86
21-Jun-19 14:15pm
View
thanks for your guidance alot ,, i never used hardcore values in query,,no idea that how it will get done [2019-05-01],[2019-05-02],[2019-05-03],[2019-05-04],[2019-05-05], so still looking for solution ,,,
akhter86
20-Jun-19 4:58am
View
Dear Chill60
I have done UNION QUERY here is my in store procedure ...
i tried this ( ALTER Procedure [dbo].[Pivot_Item2]
@StartDate Date,
@Enddate Date
AS
BEGIN
DECLARE @cols AS NVARCHAR(MAX)
DECLARE @query AS NVARCHAR(MAX)
declare @sum nvarchar(max);
SELECT @sum= COALESCE(@sum + ',','') + ('sum('+QUOTENAME(prdqty)+')') from Probale;
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT Distinct Entrydate INTO #Dates26
FROM Probale
WHERE EntryDate BETWEEN @StartDate AND @Enddate
ORDER BY EntryDate
SELECT @cols = COALESCE(@cols + ',','') + QUOTENAME( CONVERT(varchar(10),EntryDate) )
--FROM (SELECT DISTINCT DATEPART(DAY, EntryDate) AS EntryDate FROM #Dates26 ) T
FROM (SELECT DISTINCT EntryDate AS EntryDate FROM #Dates26 ) T
ORDER BY EntryDate
--SET @cols = STUFF(@cols, 1, 1, '')
SET @query =
N'with cte as (SELECT *,(select sum(prdqty) from Probale where CONVERT(varchar(10), EntryDate) =stat.ddate ) as total
FROM (SELECT Descriptionitem,Probale.prdqty,
CONVERT(varchar(10),Probale.EntryDate) as DDate
FROM Probale left JOIN ItemMasterFile on ItemMasterFile.Codeitem=Probale.Codeitem
where Probale.DelID is Null and Probale.EntryDate BETWEEN @StartDate AND @Enddate )prd
PIVOT (Sum(prdqty) FOR DDate IN (' + @cols + ')) AS stat)
select * from cte
union all
select 0,'+@sum+', (select sum(prdqty ) from Probale ) from cte'
exec sp_executesql @query , N'@StartDate datetime,@enddate datetime', @StartDate=@StartDate,@Enddate=@Enddate
END
)
but
error is coming ( Invalid column name 'ddate'.)
akhter86
20-Jun-19 4:09am
View
Dear OriginalGriff,
i tried this ( ALTER Procedure [dbo].[Pivot_Item2]
@StartDate Date,
@Enddate Date
AS
BEGIN
DECLARE @cols AS NVARCHAR(MAX)
DECLARE @query AS NVARCHAR(MAX)
declare @sum nvarchar(max);
SELECT @sum= COALESCE(@sum + ',','') + ('sum('+QUOTENAME(prdqty)+')') from Probale;
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT Distinct Entrydate INTO #Dates26
FROM Probale
WHERE EntryDate BETWEEN @StartDate AND @Enddate
ORDER BY EntryDate
SELECT @cols = COALESCE(@cols + ',','') + QUOTENAME( CONVERT(varchar(10),EntryDate) )
--FROM (SELECT DISTINCT DATEPART(DAY, EntryDate) AS EntryDate FROM #Dates26 ) T
FROM (SELECT DISTINCT EntryDate AS EntryDate FROM #Dates26 ) T
ORDER BY EntryDate
--SET @cols = STUFF(@cols, 1, 1, '')
SET @query =
N'with cte as (SELECT *,(select sum(prdqty) from Probale where CONVERT(varchar(10), EntryDate) =stat.ddate ) as total
FROM (SELECT Descriptionitem,Probale.prdqty,
CONVERT(varchar(10),Probale.EntryDate) as DDate
FROM Probale left JOIN ItemMasterFile on ItemMasterFile.Codeitem=Probale.Codeitem
where Probale.DelID is Null and Probale.EntryDate BETWEEN @StartDate AND @Enddate )prd
PIVOT (Sum(prdqty) FOR DDate IN (' + @cols + ')) AS stat)
select * from cte
union all
select 0,'+@sum+', (select sum(prdqty ) from Probale ) from cte'
exec sp_executesql @query , N'@StartDate datetime,@enddate datetime', @StartDate=@StartDate,@Enddate=@Enddate
END
)
error is coming ( Invalid column name 'ddate'.)
akhter86
20-Jun-19 3:37am
View
Dear OriginalGriff,
I want Row and Column wise Total ,,above store procedure just display date wise Total of item ,,Now i want Rows Total or each item and Column wise Total of each Date.
akhter86
17-May-19 5:08am
View
i didn't get what you saying
akhter86
17-May-19 4:04am
View
OriginalGriff i did #Date but result is not coming
akhter86
17-May-19 0:54am
View
i just run this query on sql not print col
akhter86
16-May-19 23:15pm
View
how to print out
akhter86
10-May-19 3:07am
View
what you mean to say?
akhter86
1-Feb-19 5:45am
View
Yes it will report for each employee in a day.
akhter86
1-Feb-19 1:56am
View
This error is coming...
(62 row(s) affected)
Msg 8156, Level 16, State 1, Line 21
The column '27' was specified multiple times for 'stat'.
Msg 8156, Level 16, State 1, Line 23
The column '27' was specified multiple times for 'Pvt'.
akhter86
31-Jan-19 22:00pm
View
i used
PIVOT(COUNT(Status) FOR Status IN ([P],[CL],[A])) AS New_Status
ORDER BY RNO_ROWTOTAL,''p'' ;
but same issue coming..please guide
akhter86
31-Jan-19 21:46pm
View
thanks for providing soultion
akhter86
30-Jan-19 21:51pm
View
Sorry for mistake ,,but your provided how to use , i tried us integrate with query but not giving resultMsg 102, Level 15, State 1, Line 29
Incorrect syntax near ' & @qry & '
akhter86
30-Jan-19 21:47pm
View
Dear @Santosh Kumar here is error coming
(8 row(s) affected)
Msg 207, Level 16, State 1, Line 19
Invalid column name 'Status'.
Msg 207, Level 16, State 1, Line 19
Invalid column name 'Status'.
Msg 207, Level 16, State 1, Line 21
Invalid column name 'RNO_ROWTOTAL'.
akhter86
30-Jan-19 6:36am
View
i Have data in column then i transfer it into rows,now i want row total as i Mentioned above ?
P CL A
akhter86
26-Jan-19 3:57am
View
thanks Wendelius....
For you support and thanks again ...
akhter86
26-Jan-19 3:29am
View
Dear @Wendelius
if i am giving apostrophes then executing Store Procedure it generating error (Msg 102, Level 15, State 1, Procedure Pivot_Attendance2, Line 13
Incorrect syntax near 'CL'.
Msg 137, Level 15, State 2, Procedure Pivot_Attendance2, Line 28
Must declare the scalar variable "@qry".)
akhter86
21-Jan-19 6:52am
View
hmmm
akhter86
21-Jan-19 5:31am
View
i want to mentioned leave type(PL,CL,SL) in attendance register ,i have created separate employee leave table ,here i stuck that how this table will join in employee attendance.
akhter86
21-Jan-19 1:10am
View
Deleted
Yes,you are telling me right,but just you are requested to tell me that how can i join leave of employee in attendance register ,just your hint is require then i will do..thanks
akhter86
18-Jan-19 6:16am
View
this error is coming
(6 row(s) affected)
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '('.
akhter86
10-Jan-19 5:34am
View
which solution
akhter86
10-Jan-19 5:12am
View
MadMyche
i have developed SP,it just updating INTTIME and OUTIME rest of column values are not getting calculate....Please review my code
Update EmployeesAttendance
set EmployeesAttendance.INTIME=@INTime,
EmployeesAttendance.OUTTIME=@OUTTIME,
EmployeesAttendance.Hours= ( (DATEDIFF(Hour,INTIME,OUTTIME))),
EmployeesAttendance.Day=( CASE WHEN EmployeesAttendance.Hours >= 8 THEN 1
WHEN EmployeesAttendance.Hours = 0 THEN 0
WHEN EmployeesAttendance.Hours >= 6 THEN 0.5 end),
EmployeesAttendance.OT=(CASE WHEN EmployeesAttendance.Hours > EmployeeDetails.Dhour then
EmployeesAttendance.Hours - EmployeeDetails.Dhour else 0 End),
EmployeesAttendance.OTAmount =(CASE when EmployeeDetails.OTEntitled = 'Yes'
AND EmployeesAttendance .Hours >= EmployeeDetails.Dhour
THEN (( EmployeesAttendance.Hours - 8) * 100) else 0 END ),
EmployeesAttendance.Time=( Convert(varchar(10),EmployeesAttendance.INTIME,108)),
EmployeesAttendance.Late=(Case When Convert(Time, EmployeesAttendance .INTIME,108) > EmployeeDetails.LTime Then 1 else 0
end)
From EmployeeDetails
INNER Join EmployeesAttendance ON EmployeeDetails.EmpId = EmployeesAttendance.EmpID
-- Order by EmployeeDetails.EmpID asc
where EmployeesAttendance.AttdID=@AttdID
akhter86
10-Jan-19 5:08am
View
sql server 2008 r2
akhter86
10-Jan-19 4:38am
View
my this query is working fine on select but not working on update?
akhter86
5-Jan-19 0:27am
View
Thanks for sharing CTE
akhter86
4-Jan-19 4:29am
View
i have added comment plz check thanks
akhter86
4-Jan-19 4:22am
View
Deleted
@CHill
If Hours =0 then their OT will be =0 but value are coming in minus.
akhter86
4-Jan-19 2:41am
View
@Chill60 i tried to defined you ,if you have any query please ask
akhter86
4-Jan-19 2:30am
View
Lolz,,,thanks for comment
akhter86
22-Dec-18 5:18am
View
i want if employee date of leaving is exit then that employee does not come in row of gridview
akhter86
22-Dec-18 5:16am
View
here
protected void GVEmpDetails_RowDataBound(object sender, GridViewRowEventArgs e)
akhter86
17-Dec-18 23:48pm
View
Deleted
Originalgriff this query working fine but when INTTIME exit and OUTTIME does not exit then how this handle in the query like this
ID INTTIME OUTTIME
1 2018-05-26 08:44 2018-05-26 08:44
2 2018-05-28 08:44 2018-05-28 12:44
1 2018-05-21 10:44
2 2018-05-23 08:44
akhter86
22-Nov-18 1:57am
View
error coming on this line
int customerId = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0]);
akhter86
4-Sep-18 5:03am
View
This error i am getting (The given value of type String from the data source cannot be converted to type datetime of the specified target column. )
akhter86
4-Sep-18 2:36am
View
i didn't copy and paste ,having confusion so that why i am asking question,
akhter86
21-May-18 5:19am
View
ok
akhter86
21-May-18 5:18am
View
ok,
akhter86
21-May-18 4:29am
View
will you do coding for LOOP then i can get an idea...
akhter86
11-May-18 1:23am
View
Thanks for your kind suggestion , i am beginner,so that why asking these kind of question ,i want just little help that how to connect this coding to SQL,and this coding is working which i share is working fine.
Show More