Total Monthly Expenses Don't Sum Up When I Submit

Oct 15, 2006

I have a Monthlyexpense column. How do I Sum up this column and put the Total in my ytdexpenses column. Do I use a stored procedure, because I want the monthlyExpenses to SUm up every time I submit a monthly expense to the database and siplay in the ytdExpenses Column.
When I Write a Query all of the rows in the ytdExpenses shows the same amount and do not total up every time I submit to the database. Help please.

monthlyExpenses   ytdExpenses
$1,000    $1,000
$2,000    $3,000
$3,000    $6,000
$2,000    $8,000
$5,000    $13,000

View 20 Replies


ADVERTISEMENT

Transact SQL :: Display Total Of Company Expenses

Oct 6, 2015

In the below query  want to display total of company expenses. I am unable to get the sum of weeklycomexpenses

SELECT DISTINCT e.EmpID, e.EmpName, e.StartDate, e.EndDate, ee.WeeklyComTotalExpenses FROM
EMPArgentTimeSheet AS e LEFT OUTER JOIN (SELECT CExpID, WeeklyComTotalExpenses FROM
CompanyArgentExpenses GROUP BY CExpID, WeeklyComTotalExpenses) AS ee ON ee.CExpID = e.EmpID where EmpName = 'Eberhard Neumann'
and (e.StartDate >='8/1/2015')AND (e.EndDate <= '8/31/2015') order by EmpID desc

output:

empid empname startdate enddate WeeklyComTotalExpenses
397Eberhard Neumann2015-08-23 00:00:00.0002015-08-29 00:00:00.00019.20
393Eberhard Neumann2015-08-16 00:00:00.0002015-08-22 00:00:00.000NULL
387Eberhard Neumann2015-08-09 00:00:00.0002015-08-15 00:00:00.00078.00
382Eberhard Neumann2015-08-02 00:00:00.0002015-08-08 00:00:00.00081.99

Total 8/1/2015 8/31/2015 179.19 //want to display this total info

View 9 Replies View Related

T-SQL (SS2K8) :: How To Add Up Monthly Total

Mar 7, 2014

Here is example table and data

CREATE TABLE [dbo].[sales](
[date_value] [datetime]NOT NULL,
[monthly_total] [int] NOT NULL
)
insert into sales ( date_value, monthly_total)

[code]...

How can I create a query to get below result?

YearMonthMonthlySaleAccumulated Total
2012Jan110 110
2012Feb130 240
2012Mar30 270
2012Apr60 330
2012May10 340

[code]...

View 6 Replies View Related

Query For Total Sum By Monthly / Year Wise By Reference Code

Feb 20, 2015

In the Reference_Master table I have Total count based on date for each RefCode. Can I get the total count of each RefCode by monthly wise for each year

Reference_Master

RefCode Date Count
100012/18/20074
100012/19/20078
100012/20/20074
100022/18/20073
100022/19/20072
100022/20/20076

[Code] ...

I need the result as below

Result

RefCodeMonth/YearTotalCount
10001FEB-200716
10002FEB-200711
10003Mar-20077
10004Mar-20073
10005Mar-20072
10001FEB-200816
10002FEB-200811
10003Mar-20087
10004Mar-20083
10005Mar-20082

View 8 Replies View Related

Ytd Expenses---Trigger Or Stored Procedure

Oct 16, 2006

I'm trying to come up with a Stored Procedure or a Trigger to Sum up monthly =Expenses to the YTDExpenses Column. Can Someone help please.


I have a Monthlyexpense column. How do I Sum up this column and put the Total in my ytdexpenses column. Do I use a stored procedure, because I want the monthlyExpenses to SUm up every time I submit a monthly expense to the database and siplay in the ytdExpenses Column.
When I Write a Query all of the rows in the ytdExpenses shows the same amount and do not total up every time I submit to the database. Help please.

monthlyExpenses ytdExpenses
$1,000 $1,000
$2,000 $3,000
$3,000 $6,000
$2,000 $8,000
$5,000 $13,000

View 20 Replies View Related

Submit To SQL Database

Dec 6, 2006

Hi I am totally new programing and thought I would try my hands on ASP.NET 2.0.  I created a web form that would take user information and submit it to a SQL database.  However I am not sure how to properly setup the SQL connection.  What am I doing wrong?default.aspx.cs:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page{    protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)    {    }    protected void Button1_Click1(object sender, EventArgs e)    {        String ConnStr = "Data Source=TECATE;Initial Catalog=subscribe_mainSQL;Integrated Security=True";        String SQL = "Insert into main (email,fname,lname,userid,status) values ('" + email.Text + "', " + fname.Text + "','" + lname.Text + "','" + userid.Text + "','" + degree.SelectedItem.Value + "')";    }}   default.aspx:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableSessionState="True" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>Email Sign Up Page</title></head><body style="text-align: center">    <form id="form1" runat="server">        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" OnActiveViewChanged="MultiView1_ActiveViewChanged">            <asp:View ID="signup" runat="server">        <br />        <table style="background-color: #f0f0f0" width="450">            <tr>                <td style="width: 18px; height: 23px">                </td>                <td style="font-weight: bold; font-size: medium; width: 383px; color: black; font-family: verdana;                    height: 23px">                    Email Subcribe System</td>                <td style="width: 19px; height: 23px">                </td>            </tr>        </table>        <table style="color: white; font-family: verdana; background-color: #5d7b9d" width="450">            <tr>                <td style="width: 19px; height: 20px">                </td>                <td align="center" style="width: 153px; height: 20px">                    &nbsp;</td>                <td align="left" style="width: 18px; height: 20px">                </td>                <td style="width: 115px; height: 20px">                </td>            </tr>            <tr>                <td style="width: 19px">                </td>                <td align="left" style="width: 153px">                    <asp:Label ID="Label1" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="First Name:"></asp:Label></td>                <td align="left" style="width: 18px">                </td>                <td align="left" style="width: 115px">                    <asp:Label ID="Label2" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Last Name:"></asp:Label></td>            </tr>            <tr>                <td style="width: 19px; height: 26px">                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="fname"                        ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td>                <td align="left" style="width: 153px; height: 26px">                    <asp:TextBox ID="fname" runat="server" MaxLength="20"></asp:TextBox></td>                <td align="left" style="width: 18px; height: 26px">                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="lname"                        ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td>                <td align="left" style="width: 115px; height: 26px">                    <asp:TextBox ID="lname" runat="server" MaxLength="20"></asp:TextBox></td>            </tr>            <tr>                <td style="width: 19px; height: 9px">                </td>                <td align="left" style="width: 153px; height: 9px">                    <asp:Label ID="Label3" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="10 Digit USC ID:"></asp:Label></td>                <td align="left" style="width: 18px; height: 9px">                </td>                <td align="left" style="width: 115px; height: 9px">                    <asp:Label ID="Label4" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="USC Email:"></asp:Label></td>            </tr>            <tr>                <td style="width: 19px">                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="uscid"                        ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td>                <td align="left" style="width: 153px">                    <asp:TextBox ID="uscid" runat="server" MaxLength="10"></asp:TextBox></td>                <td align="left" style="width: 18px">                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="email"                        ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td>                <td align="left" style="width: 115px">                    <asp:TextBox ID="email" runat="server"></asp:TextBox></td>            </tr>            <tr>                <td style="width: 19px">                </td>                <td align="left" style="width: 153px">                    <asp:Label ID="Label5" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Degree Status:"></asp:Label></td>                <td align="left" style="width: 18px">                </td>                <td align="left" style="width: 115px">                    <asp:Label ID="Label6" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Confirm USC Email:"></asp:Label></td>            </tr>            <tr>                <td style="width: 19px">                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="degree"                        ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td>                <td align="left" style="width: 153px">                    <asp:DropDownList ID="degree" runat="server">                        <asp:ListItem></asp:ListItem>                        <asp:ListItem>Undergraduate</asp:ListItem>                        <asp:ListItem>Graduate</asp:ListItem>                        <asp:ListItem Value="PhD">Ph.D</asp:ListItem>                    </asp:DropDownList>&nbsp;                </td>                <td align="left" style="width: 18px">                </td>                <td align="left" style="width: 115px">                    <asp:TextBox ID="confirmemail" runat="server"></asp:TextBox></td>            </tr>            <tr>                <td style="width: 19px; height: 21px">                </td>                <td align="left" style="width: 153px; height: 21px">                    &nbsp;                </td>                <td align="left" style="width: 18px; height: 21px">                </td>                <td align="right" style="width: 115px; height: 21px">                </td>            </tr>            <tr>                <td style="width: 19px; height: 21px">                </td>                <td align="left" style="width: 153px; height: 21px">                    <br />                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="email"                        ControlToValidate="confirmemail" ErrorMessage="*Emails Do Not Match" Font-Names="Verdana"                        Font-Size="X-Small" ForeColor="White"></asp:CompareValidator>                </td>                <td align="left" style="width: 18px; height: 21px">                </td>                <td align="right" style="width: 115px; height: 21px">                    <asp:Button ID="Button1" runat="server" CommandName="NextView" Font-Bold="True" Font-Names="Verdana"                        Font-Size="Small" OnClick="Button1_Click1" Text="Submit" /></td>            </tr>        </table>                <div align="center">                    &nbsp;&nbsp;                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"                        ConnectionString="<%$ ConnectionStrings:subscribe_mainSQLConnectionString %>"                        InsertCommand="INSERT INTO [main] (, [uscid], [fname], [lname], [degree]) VALUES (@email, @uscid, @fname, @lname, @degree)"                        OldValuesParameterFormatString="original_{0}" SelectCommand="                        WHERE = @original_email AND [uscid] = @original_uscid AND [fname] = @original_fname AND [lname] = @original_lname AND [degree] = @original_degree">                        <InsertParameters>                            <asp:Parameter Name="email" Type="String" />                            <asp:Parameter Name="uscid" Type="String" />                            <asp:Parameter Name="fname" Type="String" />                            <asp:Parameter Name="lname" Type="String" />                            <asp:Parameter Name="degree" Type="String" />                        </InsertParameters>                    </asp:SqlDataSource>                </div>            </asp:View>            <asp:View ID="thankyou" runat="server">                <br />                <table style="background-color: #f0f0f0" width="450">                    <tr>                        <td style="width: 18px; height: 23px">                        </td>                        <td style="font-weight: bold; font-size: medium; width: 383px; color: black; font-family: verdana;                    height: 23px">                            Email Subcribe System</td>                        <td style="width: 19px; height: 23px">                        </td>                    </tr>                </table>                <div align="center">                    <br />                    <br />                    <br />                    <asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Small"                        Text="Thank you for registering."></asp:Label>&nbsp;</div>            </asp:View>        </asp:MultiView><div align="center">&nbsp;</div>    </form></body></html> 

View 6 Replies View Related

Submit Users ID With Results.

Mar 8, 2007

Hi
I am trying to create a Quiz system and i need to put the user's Unique ID in the Result Data Table, so that the when they submit there results it puts there Unique ID by the side so that they can view it in there profile, and not anyone elses.
 Thanks
 Gareth Cork

View 1 Replies View Related

SQL-Server Job Submit From Web Page Using C#

Jun 20, 2008

Is it possible to submit a existing sql-server job from web page by using C#.
 
 

View 2 Replies View Related

How To Submit A Form To An SQL Database?

Feb 3, 2004

I have a registration form, and upon the user clicking the submit button, I want the information to be processed and sent to my SQL database. Each textbox (i.e. username, password, email address) has a corresponding field in a table in the database.

How can I accomplish this? I under stand that I will need an onclick event handler.

View 1 Replies View Related

Submit Form To Database

Dec 7, 2005

Old Frontpage user here... I need to submit a form to a database, like in Frontpage and store the database on the web server.
How do I accomplish this with Visual Studio Express...is there a ASP.NET component or do I need to code it?
Many Thanks,
Jake
p.s. my ASP.NET 2.0 books are coming for Christmas!

View 1 Replies View Related

Submit Query As A Scheduled Job....

Dec 25, 2002

I need to have an way to automatically submit a sql query in Sql
2000 - the query joins several lables and exports the info to a file.
Right now I've been doing it interactively in Query analyzer and
using the export to option... I can't use DTS (query way too
complicated!) and the file created is >255 lrecl so that seems to be
a big problem too!

Any suggestions? Save me from this same predicament on New Years Day!
Thanks and Happy Holidays! :(

View 1 Replies View Related

Cant Submit Any Sort Of Variable Data

Feb 27, 2008

Hi there, i have written a page and for a long time it worked (or so i thought) now all of a sudden it dosnt. I have gone right back to basics and tried to only insert one variable, tried using a text box, a string pre populated, or a string populated by the text box - nothing seems to work. However if i hard code in the thing that i want, even into the SQL or into my param it works, whats going on! i think my programming skills are letting me down here!
here is what i am trying to use (as you can see i have commented out all that i was using to get back to basics)
Are there any pointers?SqlConnection objConnAddStock = new SqlConnection(sAddStock);
//This is the sql statement.
 int intUpdateQSStockID = Convert.ToInt32(Request.QueryString["qsStockID"]);
string strCondition;strCondition = "Brand New 12";using (objConnAddStock)
{
objConnAddStock.Open();string sqlAddStock = "UPDATE tbl_stock SET condition = @condition WHERE stock_id = " + intUpdateQSStockID;
 
 
 
 
 /*cat_id = @cat_id, sub_cat_id = @sub_cat_id, n_or_sh = @n_or_sh, " +
"description = @description, size = @size, colour = @colour, cost_price = @cost_price, " +
"selling_price = @selling_price, condition = @condition, notes = @notes, " +
"buying_in_recipt = @buying_in_recipt, visible = @visible, picture1 = @picture1, " +
"picture2 = @picture2, [picture3] = @picture3, picture4 = @picture4, " +
"picture1_thumb = @picture1_thumb, picture2_thumb = @picture2_thumb, " +
"picture3_thumb =@picture3_thumb, picture4_thumb = @picture4_thumb, title = @title, " +
"display_price = @display_price WHERE Stock_id = " + intUpdateQSStockID;*/
 SqlCommand objCmdAddStock = new SqlCommand(sqlAddStock, objConnAddStock);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);/* objCmdAddStock.Parameters.AddWithValue("@cat_id", DropDownList2.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@sub_cat_id", DropDownList1.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@n_or_sh", n_or_shTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@description", txtDescription.Text);
objCmdAddStock.Parameters.AddWithValue("@size", sizeTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@colour", colourTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@cost_price", cost_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@selling_price", selling_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@notes", notesTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@buying_in_recipt", TextBox3.Text);
objCmdAddStock.Parameters.AddWithValue("@visible", DropDownList4.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@picture1", txtPicture1.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2", txtPicture2.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3", txtPicture3.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4", txtPicture4.Text);
objCmdAddStock.Parameters.AddWithValue("@picture1_thumb", txtPicture1_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2_thumb", txtPicture2_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3_thumb", txtPicture3_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4_thumb", txtPicture4_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@title", txtTitle.Text);
objCmdAddStock.Parameters.AddWithValue("@display_price", txtDisplay.Text);*/
 
try
{
objCmdAddStock.ExecuteNonQuery();
}catch (Exception ex)
{Label17.Text = Convert.ToString(ex);
}finally
{
objConnAddStock.Close();
}Label17.Text = Convert.ToString(intUpdateQSStockID);
 
}

View 3 Replies View Related

How Submit Db_name() As Default Parameter ?

Mar 8, 2006

Hi,
I want to submit db name as as default parameter when calling procedure WITHOUT using variables

Example
use master
go

create procedure get_caller_db @s sysname = DB_NAME() --produce error
as
select @s as [caller db name]

go
use mySuperDB
exec master.dbo.get_caller_db
--
caller db name
--------------
mySuperDB -- result I want

View 2 Replies View Related

Asp.net Form Submit To Sql Server Express

Sep 30, 2007

pls i have asp.net page that i want to connect to sql server express edition database and i want data to be submited from the page into sql server express edition database that i have in my project folder when i click on submit button pls help me with the code to do this

View 1 Replies View Related

Multi Value Parameter Cleared On Submit

Aug 17, 2007

I have a report created in Reporting Services that contains 5 parameters. Two are text [date] fields, and three are drop-down multi-value parameters. One is driven from the result of another, and both of those work fine. My issue is with the final multi-value parameter, which is simply a list of customers. It gets populated from the data set without a problem, and I can select from 1 to all of the options. However, on submitting the report. This one parameter gets cleared out, the report does not run, but instead waits for me to select the customers (again) and resubmit.

Occasionally, I can select a few customers and it will, in fact, run the report. However, 90% of the time it just clears the field and waits.

I can trace the database, and everything looks normal - on submit nothing is sent to the database, so it's not like there's a problem with the query. I've verified the customer table and all records look similar - I don't see any obvious data issues.

Suggestions?

View 4 Replies View Related

Total Page Writes/total Amount Of Data Change In A Set Period Of Time

Jun 9, 2004

Does anyone know how I can determine the number of page writes that have been performed during a set period of time? I need to figure out the data churn in that time period.

TIA

View 5 Replies View Related

Aggregated Subquery - Sum Total Trips And Total Values As Separate Columns By Day

Feb 26, 2014

Very new to SQL and trying to get this query to run. I need to sum the total trips and total values as separate columns by day to insert them into another table.....

My code is as follows;

Insert Into [dbo].[CombinedTripTotalsDaily]
(
Year,
Month,
Week,
DayNo,
Day,
Trip_Date,

[Code] .....

View 3 Replies View Related

Query By Year Group By Total Students Sort By Total For Each County

Jul 20, 2005

I haven't a clue how to accomplish this.All the data is in one table. The data is stored by registration dateand includes county and number of students brokne out by grade.Any help appreciated!Rob

View 4 Replies View Related

Reporting Services :: SSRS Group Total Expression - Add Total Disabled

Oct 26, 2015

For some reason my Add Total is grey out, when i tried to add grand total using some expression.

I have two row & two column groups?

Is there any alternative or how can i enable add total? using expression..as you can see in my Attached Image

I'm using iff condition in my expression.. 

View 15 Replies View Related

SQL Server 2008 :: Pulling Daily Total From Cumulative Total

Jun 28, 2015

I have a table that writes daily sales each night but it adds the day's sales to the cumulative total for the month. I need to pull the difference of todays cumulative total less yesterdays. So when my total for today is 30,000 and yesterday's is 28,800, my sales for today would be 1,200. I want to write this to a new field but I just can't seen to get the net sales for the day. Here is some sample data. For daily sales for 6-24 I want to see 2,000, for 6-25 3,000, 6-26 3,500, and 6-27 3,500. I'm thinking a case when but can't seem to get it right.

CREATE TABLE sales
(date_created date,
sales decimal (19,2))
INSERT INTO sales (date_created, sales)
VALUES ('6-23-15', '20000.00'),
('6-24-15', '22000.00'),
('6-25-15', '25000.00'),
('6-26-15', '28500.00'),
('6-27-15', '32000.00')

View 9 Replies View Related

Insert Same Data To Two Different Tables With One Submit Button....

Apr 8, 2004

I would like to insert a set of data to my database to 2 different tables.
what will be the SQL Statement for such ? Is it possible to do so?

for example, a webpage contain 2 textbox which require user to key in data. Once click submit button. the info will saved to 2 tables....

View 3 Replies View Related

Forms To View / Edit / Submit To Server

Nov 5, 2013

Currently, I have a set of data that is available on a SQL Server. I want to be able to display the information in the front-end (ie. Access form, excel, webpage?), and if the user wants to edit any information they may do so and with a click of a button, submits to the sql server.

View 1 Replies View Related

All I Wanted Was To Submit Customers Info To My Emailbox

Jan 28, 2008

I have created an order form for my business. I placed a submit button at the bottom. I wanted all the clients information to go into my emailbox. Someone told me about MS SQL Server. I got excited and downloaded the 2005 Express version with all the trimmings. Now I am more confused than I was before. Someone please explain to me what I should do first. Redo the form with the studio then work with the server? I think I may have deleted something important from the server trying to figure it out. Help!!!!!!!!!!

View 7 Replies View Related

Total Record Count - Pagination With Total Rows

Jul 26, 2013

My table contains 1000 records,

I need to know the total record count with the below paging query

SELECT EmpName,Place
FROM EmplyeeDetails ORDER BY Place
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

How to get?

View 2 Replies View Related

Adding Subreport Total To Main Report Total

Apr 28, 2006

Hi, can anyone help?

I have created a Report using Visual studio-the report displays a subreport within it.

On the Subjective Report I have 12 values for each month of the year.

For the first month the value is =sum(Fields! Month_1.Value), and I
have named this text box €™SubRepM1€™
The name of the subreport is €˜subreport1'.

On my Main Report, again I have 12 values for each month of the year.
For the first month the value is =sum(Fields! Month_1.Value)*-1, and I
have named this text box 'MainRepM1'
The name of the main report is 'GMSHA Budget Adjustment Differentials'

The report displays both of the subreport and main report values
but I now need to total these values together for each month in order to
produce a grand total.

I have tried using the following to add the totals for Month 1 together,
=subreport1.Report.SubRepM1 + MainRepM1
but this does not work and I get the following error message €˜The value expression for the text box 'textbox18'contains an error [BC30451] Name subreport1 is not declared'.

I feel that it should be a simple matter of adding the two sets of values together but I€™m having major problems trying to get these totals to work.

Can anyone help, thanks

View 7 Replies View Related

Unable To Submit More Than 8000 Characters With Stored Procedure

Jul 20, 2005

Hi all,I have a internet page written in asp to submit into authorscurriculum vitae publications (title, author, year, etc.).If the author submit less than 8000 characters it functions OK, but Ifthe author try's to submit more than 8000 characters the asp page doesnot return an error but the text is not saved in the database or,sometimes, it returned a "Typ mismatch" error.Here is the sp:---------------------------------------------------------------------CREATE PROCEDURE sp_CV_publications(@formCommandnvarchar(255)='process',@id numeric=null,@id_personint=null,@typPubID tinyint= NULL,@publicationstext=null)ASif @formCommand='process'beginINSERT INTO CV_publications(idperson,typPubID,publications)VALUES (@id_person@typPubID,@publications);select 1 as status, @@IDENTITY AS insertedID, * FROMCV_publications WHERE id=@@IDENTITYend----------------------------------------------------------------------------The server is running IIS5 and SqlServer 2000Any ideas ???

View 1 Replies View Related

Total Spaceused And Total Allocated

Jul 20, 2005

Anyone has a "one sql statement" to get the total spaceused and totalspace allocated of an instance ? ie same as sum of relevance fieldsfrom sp_spaceused for each database in an instance, that works accrossversion of mssql from 6 onward.ThanksKD

View 1 Replies View Related

Monthly Report

Apr 15, 2008

Hi,

I m Maran. I am trying to write a SQL Query to retrieve the following report format. But I'm not sure how to go about it.

Input values:

Starting Date: 09/14/2007
End Date: 12/06/2007

Monthly Report :

Start Date - End Date - Number of companies
09/14/2007 - 09/30/2007 1
10/01/2007 - 10/31/2007 0
11/01/2007 - 11/30/2007 4
12/01/2007 - 12/06/2007 0

Please its very urgent, Plz do the needful help. Actually this same report format i was posted already and got some methodology, but its not satisfied my requirements :( :(

Used Table: CompanyHistorytrackTable

companyId changed_date
50198 2007-09-05 13:11:17.000
48942 2007-09-14 12:42:30.000
48945 2007-11-06 12:05:31.000
47876 2007-11-14 10:58:21.000
43278 2007-11-16 16:14:25.000
43273 2007-11-16 16:16:11.000
51695 2008-02-04 11:05:09.000
47876 2008-01-21 14:10:02.000
44604 2008-02-04 19:33:02.000
46648 2008-02-04 19:35:30.000


Manimaran.Ramaraj
Software Engineer
Aspire Systems
Chennai - 600 028

View 3 Replies View Related

Monthly CD Billing Import

Aug 4, 2006

Greetings;
I recieve a monthly phone bill on cd. I am trying to autoimport these CD's into a SQL server database with a DTS in MSSQL 2000. I have noticed on the bills every so often they change the structure of one of the ACCESS DB tables by one row or something small.
I am trying to figure out how I can test the structure of the database before trying to do the actual imports, I want to do this so someone else can actually do the imports as we get the bills.
Is this a possibility? Or am I going about this all wrong?
 
Thanks
nhas

View 2 Replies View Related

TSQL - Monthly Script

Jan 14, 2008

I need to run a script on a monthly basis (e.g at midnight on the last day of the month) which selects all the records from that calendar month. I have the below so far however as each month has a different number of days in it this will not work well. Are there any date/time criteria I can use in my tsql statement which will only select records from that month no matter how many days are in the month? I obviously need to move away from manually updating the script each month depending upon how many days are in the month!  
SELECT     *FROM         UserLogwhere logtime >= (getdate() - 30)order by logtime asc
cheers
marco

View 2 Replies View Related

Reg: Weekly - Monthly Report

Apr 5, 2008

Hi All,

I am Maran. Am facing the problem to retrieve the following format of output using the sql query. Is it possible 2 solve this.. I tried this, but i am unable to.

Input values:

Start Date: 2/17/2008
End Date : 5/8/2008

Output Format:

2/17/08 - 2/29/08 (Partial Month) 12
3/1/08 - 3/31/08 (Full month) 0
4/1/08 - 4/30/08 (Full month) 22
5/1/08 - 5/8/08 (Full month) 10

I want the above format of the monthly report. I really could use some help on this. thanks.

~ Maran

Manimaran.Ramaraj
Software Engineer
Aspire Systems
Chennai - 600 028

View 3 Replies View Related

Monthly Archiving Of Tables?

Mar 27, 2014

The Database will hold 2 tables. One of those includes dates. They are joint by a constraint using an ID. What i got to do is, store the tables in a different schema named after the month the data was created. I will have to keep the original tables aktive because this should work while accessing the tables but can flush the data to keep the database small. So i would end up with 2 tables in 1 schema for every month and the productive that keeps track of the current bookings.

I would have access to the enterprise edition if that changes anything at all.

View 3 Replies View Related

Aggregation On Monthly Base

Jul 24, 2006

I need to create a report containing the headcounts of the employees for each month. The data I can retrieve from the database looks like this:









Name
StartEmp
EndEmp

tom
1/jan/05
15/mrt/05

dirk
1/jan/05
31/mrt/06

jan
1/feb/05
NULL

In order to get the right information for the report the information should be represented in the following way:











January 2005
February 2005
March 2005
"April" 2005

Tom
1
1
0,5
1

Dirk
1
1
1
1

Jan
0
1
1
1

HeadCount
2
3
2,5
3
(there should be more data in the 2nd table but it's a sliced representation of the data. Sliced by 2 report parameters: startdate (=1 January 2005) and enddate (=30 April 2005) )

I need some help about building up the query to aggregate the info from table1 to the format of table2.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved