15,896,040 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 XCode2010 (Top 6 by date)
XCode2010
11-Sep-14 7:09am
View
Man this is my sql statement. How can I make that through this.
<pre lang="SQL">
SELECT Customer_Transaction.Order_Number, Customer_Purchased.ProductID, Customer_Purchased.productName, Customer_Purchased.Branch,
Customer_Purchased.quantity, Customer_Transaction.Total_Purchased, Customer_Purchased.Date_Purchased
FROM Customer_Purchased INNER JOIN
Customer_Transaction ON Customer_Purchased.Item_Purchased_Number = Customer_Transaction.Item_Purchased_Number
WHERE (Customer_Purchased.Branch = 'SM Dasmariñas') AND (Customer_Purchased.Date_Report BETWEEN '9/1/2010' AND '9/15/2010')
</pre>
XCode2010
9-Sep-14 22:49pm
View
Wtf! I don't see that. Haha. Sorry man and thanks ;)
XCode2010
3-Sep-14 11:13am
View
Yes, its doesn't show on my gridviews. Can you suggest me better ways to create a report in that query? BTW this is my gridview and thanks for answering.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
EmptyDataText="There are no data records to display." BackColor="#CCCCCC"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4"
CellSpacing="2" ForeColor="Black" Width="726px">
<columns> <asp:BoundField DataField="Order_Number" HeaderText="Order #"
SortExpression="Order_Number" />
<asp:BoundField DataField="Item_Purchased_Number"
HeaderText="Purchased #" SortExpression="Item_Purchased_Number" />
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
SortExpression="ProductID" />
<asp:BoundField DataField="productName" HeaderText="productName"
SortExpression="productName" />
<asp:BoundField DataField="quantity" HeaderText="quantity"
SortExpression="quantity" />
<asp:BoundField DataField="Branch" HeaderText="Branch"
SortExpression="Branch" />
<asp:BoundField DataField="Date_Purchased" HeaderText="Date_Purchased"
SortExpression="Date_Purchased" />
<footerstyle backcolor="#CCCCCC">
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<rowstyle backcolor="White">
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<sortedascendingcellstyle backcolor="#F1F1F1">
<sortedascendingheaderstyle backcolor="#808080">
<sorteddescendingcellstyle backcolor="#CAC9C9">
<sorteddescendingheaderstyle backcolor="#383838">
XCode2010
2-Sep-14 4:45am
View
SqlCommand cmd = new SqlCommand("SELECT Customer_Transaction.Order_Number, Customer_Purchased.ProductID, Customer_Purchased.productName, Customer_Transaction.Branch, Customer_Purchased.quantity, Customer_Purchased.Date_Report FROM Customer_Purchased INNER JOIN Customer_Transaction ON Customer_Purchased.Item_Purchased_Number = Customer_Transaction.Item_Purchased_Number WHERE Customer_Purchased.Date_Report >='" + startdate + "' AND Customer_Purchased.Date_Purchased <='" + enddate + "'");
->> I USE THE TECHNIQUE YOU THOUGHT ME SIR MAXX AND IT WORKS THE PROBLEM IS IT NOW SHOW ON MY GRIDVIEW.
XCode2010
2-Sep-14 4:33am
View
protected void Button2_Click(object sender, EventArgs e)
{
string startdate = ddlDay.Text + "/" + ddlMonth.Text + "/" + ddlYear.Text;
string enddate = ddlDay2.Text + "/" + ddlMonth2.Text + "/" + ddlYear2.Text;
SqlCommand cmd = new SqlCommand("SELECT Customer_Transaction.Order_Number, Customer_Purchased.ProductID, Customer_Purchased.productName, Customer_Transaction.Branch, Customer_Purchased.quantity, Customer_Purchased.Date_Report FROM Customer_Purchased INNER JOIN Customer_Transaction ON Customer_Purchased.Item_Purchased_Number = Customer_Transaction.Item_Purchased_Number WHERE Date_Report BETWEEEN'" + startdate + "'AND'" + enddate + "'");
DataTable dt = GetData(cmd);
GridView1.DataSource = dt;
GridView1.DataBind();
}
This is my code and I got an error "An expression of non-boolean type specified in a context where a condition is expected, near 'BETWEEEN'." Can you help me sir MAXXX?
XCode2010
31-Aug-14 22:00pm
View
Im using SQL Server 2008 for my database. Yes I heard that between operator but I dont know how I will use it. For example I have a 2 set of drop down list for the start date and end date. Is this correct? "SELECT ProductID,price,ProductName,Qty FROM Transaction bewteen '" + ddldatestart "'AND'" + ddldateend '";
Where ddldatestart and end format is mm/dd/yyyy? How about the time like this "1:31:53 PM"?
Show More