15,909,091 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 Member 10322487 (Top 3 by date)
Member 10322487
9-Oct-13 0:59am
View
Deleted
using System;
using System.Collections;
using System.Configuration;
using System.Data;
//using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
//using System.Data.SqlClient;
using System.Data.OleDb;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string assign = Session["assignee"].ToString();
string sda = Session["sdate"].ToString();
string eda = Session["edate"].ToString();
string gd = Session["gdt"].ToString();
string ld = Session["ldt"].ToString();
OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;Data source=E:\\downtime2\\App_Data\\datediff$.mdb");
//str((SUM([percent])/count([percent])),7,2)
string str = "select str((SUM([Calculated(on time)])/count([Calculated(on time)])),7,2) from datediff$ where Assignee = '" + assign + "' and [Creation_date] >='" + sda + "' and [Creation_date] <= '" + eda + "' and [Calculated(on time)] >= '" + gd + "' and [Calculated(on time)] <= '" + ld + "' ";
// string str = "select * from datediff$ where Assignee = '" + assign + "'";
// string str = "select sum([id1])/count([id1]) from calculation where id1 between'" + sda + "' and '" + eda + "'";
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = str;
con.Open();
//OleDbDataReader dr = cmd.ExecuteReader();
Label1.Text = cmd.ExecuteScalar().ToString();
//cmd.ExecuteNonQuery().ToString();
//Label1.Text = assign;
con.Close();
string select2 = "select str(((SUM([Calculated(on time)])/(4000*90*8))*100),7,2) from datediff$ where [Assignee] = '" + assign + "' AND [Creation_date] >='" + sda + "' AND [Creation_date] <= '" + eda + "' and [Calculated(on time)] >= '" + gd + "' AND [Calculated(on time)] <= '" + ld + "' ";
OleDbCommand cmd2 = new OleDbCommand();
cmd2.Connection = con;
cmd2.CommandType = CommandType.Text;
cmd2.CommandText = select2;
con.Open();
Label2.Text = cmd2.ExecuteScalar().ToString();
con.Close();
string select3 = "select max([Calculated(on time)]) from datediff$ where [Assignee] = '" + assign + "' AND [Creation_date] >='" + sda + "' AND [Creation_date] <= '" + eda + "' and [Calculated(on time)] >= '" + gd + "' AND [Calculated(on time)] <= '" + ld + "' ";
OleDbCommand cmd3 = new OleDbCommand();
cmd3.Connection = con;
cmd3.CommandType = CommandType.Text;
cmd3.CommandText = select3;
con.Open();
Label3.Text = cmd3.ExecuteScalar().ToString();
con.Close();
string select4 = "select min([Calculated(on time)]) from datediff$ where [Assignee] = '" + assign + "' AND [Creation_date] >='" + sda + "' AND [Creation_date] <= '" + eda + "' and [Calculated(on time)] >= '" + gd + "' AND [Calculated(on time)] <= '" + ld + "' ";
OleDbCommand cmd4 = new OleDbCommand();
cmd4.Connection = con;
cmd4.CommandType = CommandType.Text;
cmd4.CommandText = select4;
con.Open();
Label4.Text = cmd4.ExecuteScalar().ToString();
con.Close();
string select5 = "select min([percent]) from Datediff$ where [Assignee] = '" + assign + "' AND [Creation_date] >='" + sda + "' AND [Creation_date] <= '" + eda + "' AND [Calculated(on time)] >= '" + gd + "' AND [Calculated(on time)] <= '" + ld + "' ";
string select5 = "select str(((cast(c.a as float)/cast(d.b as float))*100),7,2) from (select COUNT(Time_diff) a from datediff$ n where n.Time_diff>72 and [Assignee] = '" + assign + "' AND [Creation_date] >='" + sda + "' AND [Creation_date] <= '" + eda + "' and [Calculated(on time)] >= '" + gd + "
Member 10322487
9-Oct-13 0:36am
View
error is coming at sql clause i.e.,79 to 85 line
Member 10322487
9-Oct-13 0:35am
View
error is coming at line 70 to 85.