Viewing 15 posts - 4,726 through 4,740 (of 15,381 total)
You're welcome. Glad that worked for you.
May 28, 2014 at 2:58 pm
jbalbo (5/28/2014)
trying to add a case statement to below so when enddate is null then use getdate()
Thanks
Joe
DECLARE @startdate datetime2 = '2007-05-05 12:10:09.3312722';
DECLARE @enddate datetime2 = '2009-05-04 12:10:09.3312722';
SELECT DATEDIFF(day,...
May 28, 2014 at 2:49 pm
josetur12 (5/28/2014)
DROP TABLE [dbo].[Order]
GO
CREATE TABLE [dbo].[Order](
[OrderID] [int] NOT NULL)
Insert into [dbo].[Order]
(OrderID)
SELECT 100 UNION ALL
SELECT 101 UNION ALL
SELECT 102
DROP TABLE [dbo].[OrderDetail]
GO
CREATE TABLE [dbo].[OrderDetail](
[OrderID] [int] NOT...
May 28, 2014 at 2:47 pm
Any chance you can turn that into insert statements? Also, need at least a row or two for Orders (that is in your select statement ). 😀
I am still rather...
May 28, 2014 at 2:22 pm
Ed Wagner (5/28/2014)
whereisSQL? (5/28/2014)
Ed Wagner (5/28/2014)
Sean Lange (5/28/2014)
crookj (5/28/2014)
Ed Wagner (5/28/2014)
BWFC (5/28/2014)
GeeseHunting
:Wabbitt!
Duck!
Baseball
Steroids
Cheating
Marriage
May 28, 2014 at 2:20 pm
sgmunson (5/28/2014)
It's even simpler:
DECLARE @dteTo AS date = GETDATE();
There's no need for a CAST or a CONVERT, as implicit conversion works just fine for this purpose.
Is there an echo in...
May 28, 2014 at 2:19 pm
How about the Order table and a few rows of sample data? I think I see where you are trying to go but want to be sure and with tables...
May 28, 2014 at 1:40 pm
MMartin1 (5/28/2014)
WITH Ordered AS
(
SELECT*, ROW_NUMBER() OVER ( PARTITION BY name ORDER BY Id) AS RN
FROM #mytable where ID
in ('TIX123','TIX999')
)
select * from ordered
where RN=1
to move the...
May 28, 2014 at 1:26 pm
jamie 35248 (5/28/2014)
May 28, 2014 at 1:23 pm
sqlnaive (5/28/2014)
May 28, 2014 at 1:16 pm
One other point of concern. I noticed you are using the REAL datatype. This is not an exact numeric type, it is an approximate datatype so if accuracy is important...
May 28, 2014 at 12:01 pm
mrmnew (5/28/2014)
May 28, 2014 at 11:53 am
prepaess (5/28/2014)
in fact i am too pressed i should finish this part now 🙁
as i modified above it is the date of buying the...
May 28, 2014 at 11:46 am
Hi and welcome to the forums. In order to help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample data in the form...
May 28, 2014 at 10:30 am
adonetok (5/28/2014)
There are about 10 select statements in a store procedure.All select statements are need.
Is it possible to output only the result of last select statement?
Remove the other select statements?
May 28, 2014 at 9:03 am
Viewing 15 posts - 4,726 through 4,740 (of 15,381 total)