Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Friday, March 23, 2012

Help on elapse time to return data ??

Dear all,
I have build an ASP.net application which calls different store procedure.
When my customer request data from store procedure, I would like to display
on the page, the time it takes to return data.
How to do that ?
regards
sergeSomething like that
create proc myproc1
as
--here is your body's code
--usage
declare @.dt datetime
set @.dt=getdate()
exec myproc1
select datediff(s,@.dt,getdate())
drop proc myproc1
"serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
message news:0A3D7622-0901-420D-A5F1-CCF7127BE43C@.microsoft.com...
> Dear all,
> I have build an ASP.net application which calls different store procedure.
> When my customer request data from store procedure, I would like to
> display
> on the page, the time it takes to return data.
> How to do that ?
> regards
> serge|||To add to Uri's response, you can also calculate the elapsed time in your
application. C# example:
DateTime startTime = DateTime.Now;
//execute query
TimeSpan duration = DateTime.Now.Subtract(startTime);
Response.Write(duration.ToString();
Hope this helps.
Dan Guzman
SQL Server MVP
"serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
message news:0A3D7622-0901-420D-A5F1-CCF7127BE43C@.microsoft.com...
> Dear all,
> I have build an ASP.net application which calls different store procedure.
> When my customer request data from store procedure, I would like to
> display
> on the page, the time it takes to return data.
> How to do that ?
> regards
> serge|||Thnaks dan, I will do that
regards
serge
"Dan Guzman" wrote:

> To add to Uri's response, you can also calculate the elapsed time in your
> application. C# example:
> DateTime startTime = DateTime.Now;
> //execute query
> TimeSpan duration = DateTime.Now.Subtract(startTime);
> Response.Write(duration.ToString();
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "serge calderara" <sergecalderara@.discussions.microsoft.com> wrote in
> message news:0A3D7622-0901-420D-A5F1-CCF7127BE43C@.microsoft.com...
>
>

Monday, March 19, 2012

Help Needed!

Hey all, I need some help to build some data bases and maybe some more
stuff. Please reply only if you can do it volunteerly or very cheap please;
but there is incentives in time..

TIACPS (bryan.latimer@.computerpartssource.com) writes:
> Hey all, I need some help to build some data bases and maybe some more
> stuff. Please reply only if you can do it volunteerly or very cheap
> please; but there is incentives in time..

Help you can get in this newsgroup if you specify your problems clear
enough, and the explanation can be fit into a regaular newspost.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Ok, my bad people

I need this

User name
A generated password and then they change it

Personal info
Name, Address, Ph. email etc.
Location of sale--URL
What is it
Price of sale
Date/who posted it

And able to cross reference it with another data base..

Does this help you our more.. Sorry I am naive to all this..
"CPS" <bryan.latimer@.computerpartssource.com> wrote in message
news:cJSLd.248168$6l.14861@.pd7tw2no...
> Hey all, I need some help to build some data bases and maybe some more
> stuff. Please reply only if you can do it volunteerly or very cheap
please;
> but there is incentives in time..
> TIA|||You should probably get in touch with someone in your area who can come
to your site and help you with what you want. I suggest posting a job
offering on www.craigslist.com explaining what you need. This newsgroup
is more for helping people with immediate problems versus designing an
entire solution.|||I can Help you If you want.

Monday, March 12, 2012

Help needed to build "splitted by year totals" query

Hello
I have a table with the following fields
DateFROM
DateTO
Ammount
Storing, you have guessed it, amounts for a period.
My problem is that I will need to split (and prorate) amount per year.
For instance if I have
DateFROM ! DateTO ! Ammount
--
01/jan/04! 31/dec/05! 100
I'd like the query to return two rows
DateFROM ! DateTO ! Ammount
--
01/jan/04! 31/dec/04! 50
01/jan/05! 31/dec/05! 50
Ideally I'd need to account for bissextile years...
Any idea how to achieve this. Definitely too complex for me :)
Thanks & regards
--alexTUsing a calendar table would solve this issue quite easily. Build one for
the required duration and use it in your query involving the JOIN. If you
need a specific query, refer to: www.aspfaq.com/5006 and post required
information for others to repro your problem.
Anith

Friday, February 24, 2012

Help me to understand!

Hi All,

I need to build a report which is showing client who did not order since particular period, but have ordered within the past 3 months.

Is anyone can help me to understand the technique to get that data?

Thanks in advance.

hi Ron,

you need help in query or designing the reports.

query i think will be like this

select CustomerName from Customers Where CustomerId not in (select distinct customerid from Orders where OrdDate between @.fromdt and @.todt)

and CustomerId in (Select distinct customerid from Orders where orddate betwen getdate() and dateadd(m,-3,getdate())

hope it works.

regards,

satish

|||

Thanks Satish,

It works.

|||

Hi Satish,

Now my problem is that I want just showing the customer with the last invoice date. So something like this:

CustName Inv.Date
MER01 09/06/2006
JUN01 09/30/2006

Right now, I got multiple item with the same customer since their invoice date is different. I try using MAX(InvoiceDate), but
it seems did not work out.

Any idea...

|||I solved the problem. Thanks.|||

hi ronn

see if following helps out in case you want separate query if you want with earlier one let me know but first try if you can fight a bit on your own :)

select top 1 CustomerName, InvDate from Customers Inner Join Invoice on Invoice.CustomerID = Customer.CustomerID

group by CustomerName, InvDate

order by InvDate Desc

regards,

satish

Sunday, February 19, 2012

Help me how to build this

Hi
Please help me writing the sql query .

I have got a DataBase table with fields and Data like this
------------------
job_id hours invoice_id
-------------------
1 2 null(MEANS NOT INVOICED)

1 3 2(MEANS INVOICED)

2 4 3(MEANS INVOICED)

2 5 null(MEANS NOT INVOICED)

---------------------
Now I want to show a report which shows HOW many hours are invoiced and not invoiced
on a JOB. The Report should be some thing like this

-----------------------
Job_Id Hours_Invoiced Hours_Not_Invoiced
1 3 2
2 4 5
------------------------

Please help me writing the sql query to return data like above
ThanksAssuming Invoice_id is a number greater than or equal to zero, use IsNull to convert null Invoice_id's to -1 and then use that to segregate the values. Something like:


SELECT
job_Id,
Sum( CASE WHEN IsNull(invoice_id,-1) >= 0 THEN hours ELSE NULL END) as Hour_Invoiced,
Sum( CASE WHEN IsNull(invoice_id,-1) = -1 THEN hours ELSE NULL END) as Hours_Not_Invoiced
FROM YourTable
Group BY Job_Id
Order BY JobId