SQL Server :: Unable To Show Customers With Their Order Totals?
Feb 10, 2011
ing to show customers and their order totals. There are a few joins involved since the order items quantity and price come from 2 different tables. Here is the query:
select DISTINCT
c.custnumber
ordertotal = convert(money, (SUM(c.quantity) * d.Price))
from custOrders c
left join purchaseorders p on p.cust_code = c.cust_code and p.purchno = c.ponumber
left join purchasedetail
[code]...
I've created a perfect matrix report using the nifty wizard and it's exactly what the client wants, but they would also like to see the detail for each row.I'm able to create subreports and pass parameters and all that jazz, but I'm having a hard time setting up a subreport for this matrix.
I insert a group in a report table in the layout screen then the next row I add above orbelow it, automatically becomes agroup row too. I need to show totals at the bottom and just need a plain row not a group row. Can some one please explain the procedure to do it.
i am using sql server reporting service, in My report i have a Salaray column in which i have to show the page wise totals in every page and grand total in last page..
example : first page salary total - 10000
second page salary total - first page total(10000) + second page total and so on I did use the =sum(ReportItem("Salary").value) but it does not consider the previous page value..
I need to write a stored procedure to schedule a job that will send automatic email to customers based on some condition as follows:
1. I have two tables. One table is table1 like the following:
Name Date1 Date2 Date3 Rahim, Khan 29'10 30'11 25'08 Karim,Abedin 12'10 28'11 26'09 Fahad, Alam 26'10 12'11 25'10 Another Table is table 2 like the following:
Name Email Rahim,Khan rahim@yahoo.com Karim,Abedin karim@yahoo.com Fahad, Alam falam@yahoo.com In table 1 the date format is in format where 30'11 mean work week is 30 and 11 means last two digits of the year.
2. Now , I need to write a stored procedure that will check :
a) What is current work week and current year?
b) It will then determine the difference between the current work week (now 37) and work week mentioned in date (Date1, Date2 and Date3) columns from table1 and if for current year(it's 2010) at least one difference in each row is>=8 then it should send an automatic email to the corresponding email address of Name column using the relation between Table1 and table2. For example: For first record in Table1 the three difference is: 37-29=8, 37-30=7 and 37-25=12. There are two differences >=8, but only first difference is for year 2010 and third one is not for current year. But, since at least one difference in this row satisfies condition (That means >=8 for year 2010)hence email message should be sent to the address rahim@yahoo.com using relation of table1 and table2.
I know how to set a schedule job in SQL mail but I need this stored procedure to run this job on daily basis.
I have the following query, the relationship is mutiple pictures per dog and multiple dogs per registered User. the query below will return dogs that belong to users that have not expired. the problem is that some users have many dogs and other users only have one dog listed, the query below will return a record for every dog. What I would like to do is return a random dog per user and only one dog per user each time the query executes. therefore if I have 10 users and 50 dogs I would like my quesry to only return 10 dogs one beloinging to each user, and the next time the quesry executes it would be nice if it once again return 10 dogs but a different 10 dogs 1/per user where it was able..
I am not able to use the below namespaces in order to Run a powershell script:
using System.Management.Automation; using System.Management.Automation.Runspaces;
I have installed Windows Powershell 2 and the framework is 2.0. I have added the referenece System.Management in the web.config file. Also i have browsed the above 2 namespaces and added to the project in add reference tab. Still i get the below message:
CS0234: The type or namespace name 'Automation' does not exist in the namespace 'System.Management' (are you missing an assembly reference?)
I have a databound dropdownlist hooked up to a table and the query has the returned items show up in order. I also have some default items that are _DataBound like so:
[Code]....
What I'd like to do is add some more items, but have these new items show up in order with the other items displayed from the query. How do I accomplish this?
I am developing Online Food Ordering web application[asp.net+Sql]. I want to show automatic popup at admin side when user order for food. (Like fb notification).  When user place order that time admin should get automatic popup.Â
I have "add new folder" button in my asp.net form and I need to show dialog in order to make the user able to enter the folder name,how can I accomplish that in asp.net?
The problem is I had to create a draftResult class in order to show data that resides in two different tables using linq which means if i want to add or remove a column i will need to do so in the draftresult and in my linq. Here's what my setup looks like: I have two tables (draft, lookUpStatus)
draft table columns idname,status id lookupStatus idtitle public class draftResult { public string draftName {get; set;} public string status {get; set;} }
I want to list the draft name and the status title in a table view. In order to do this, I wrote the following linq in a method in my sqlRepository class and return it to a IQueryable<draftResult>. My controller instanstiates the sqlRepository object and invokes GetDraftListing().
public class sqlRepository { private Table<Draft> _draft; private Table<LookUpStatus> _lookupubStatus; public IQueryable<draftResult> GetDrafLtisting() { return (from draft in _draft join status in _lookuptatus on draft.StatusID equals status.ID select new draftResult { draftName = draft.name, status = status.Title }); } }
The above process works but does not seem as flexible and i'm trying to get a better understanding of MVC and LINQ.
I have 5 hard corded texboxes in a page in a sequence with sequence Number . Now i want to add re-order /re-arraning functionaly .. but i can't use ajax reorder list because i have 5 hard corded texbox. how can i maintain the order in Insert/Update cases. And also suggest me control that i can use, another than ajax re-order list. coz i not using any list items i have hard corded items on the page.
The AjaxToolkit has a ReorderList. I'm searching for a jQuery solution that does the same and found this page. I would like to change the order of divs (vertically) and upload the new order to the database (ajax).
What i need is i need to bind last 10 Order in Gridview/details view with paging, and the same order detail also fetch from database and shown in another gridview.. if user click any oderNo in first Gridview/DetailView then i need to show Respective order detail in anther gridview..
without postback coz we already fetch 10 order with orderdetails from the database..and if user click next 10 orderNo using paging then again we need to load 10 orderNo with respective orderdeatils from database like this going on....as well as let me know how to take print of particular oder and order detail....?
From my testing, it appears that the order of parameters for the UpdateParameters must match both the order of the bound fields on the form (asp:Formview), and the order of the parameters in the UpdateCommand. Is that correct? If so, why do the parameters have names if all that matters is the order? I tried both asp:ControlParameter and asp:Parameter. Maybe the more relevant question is why aren't the names used instead of the order, particularly for the form order?
So, given I display the Identity field (CID), and need that for the update, I cannot get the update to work without including it in the UpdateCommand. Of course, since it is an autonumber field in Access, I cannot actually set it. So, I had to add another field to the db (lngUpdateCID) that I could set. That can't be how it has to be done, but I could not figure out another way to do this.
I have a table of persons that used for different purposes in a database. One of those purposes is to present a list of organization contacts to users. I use a gridview and stored procedures to get the data.
On one page listing all organization contacts the client requires the order of the persons to be presented as President first, Vice President second, Secretary third, etc. I accomplished this requirement by simply entering the persons in the table in the order in which they were required to be displayed on that particular page.
But then on another contacts page the client requires only a subset of the persons in the table to be displayed, moreover, the order of the persons is to be presented as Secretary first, Office Administrator second, President third and Vice President fourth.
I have no idea how to pull the data into my gridview in the order that's required for the 2nd page. I thought about adding a column in the table that I could use to store a numeric value and then order by that value in the procedure that pulls the data for the second contact page, but this somehow seems wrong.
I have four dropdowns on a page. Lets say for example all four are set to "3".When I click calculate my totals are returning as "3333" instead of "12".
Code: Dim totals As Integer totals = ddl1.SelectedValue + ddl2.SelectedValue + ddl3.SelectedValue + ddl4.SelectedValue lbltotals.text = totals.tostring