Viewing 15 posts - 16 through 30 (of 314 total)
Make sure to read this post to understand how datetimes work in SQL Server
September 7, 2010 at 7:22 am
Steve Jone's code can be simplified to
SELECT IDval, DateStart, TimeStart
FROM dbo.DateTimeTest
WHERE ( (DateStart = '9/4/2010' AND TimeStart >= '20:00') or (datestart = '9/5/2010' AND TimeStart < '08:00'))
September 7, 2010 at 7:14 am
See also what you can do with row_number() function
September 7, 2010 at 7:09 am
Note that @s1 is declared as varchar(10) whereas @s2 as varchar(20). Use varchar(20) for @s1 and see the result. It gives the correct result
DECLARE @TB TABLE (id INT,name varchar(10))
INSERT...
September 7, 2010 at 7:02 am
Also if you want to show formatted dates in any front end application, do formation there. Otherwise to simplify the code, use a derived table
select mycol from
(
select *,convert(varchar(20),mydatecol,103) as mycol
)...
September 7, 2010 at 6:57 am
No. I don't any delay in this site. Check your network speed
September 7, 2010 at 6:46 am
Have a million row table and do running total using a triangular join
select col,
(select sum(col) from table as t1 where t1.pkcol<=t2.pkcol) as run_sum
from table as t2
September 7, 2010 at 6:45 am
The post in incomplete. Edit your post and content
September 7, 2010 at 6:37 am
You can also make use of row_number() function as described here
September 7, 2010 at 6:36 am
It is not possible to import data where there are different number of columns
September 7, 2010 at 6:35 am
When dealing with sql injection, here is a derived table approach that can avoid it
May 20, 2010 at 2:14 am
Jeff Moden (2/25/2010)
Mike M - DBA2B (2/25/2010)
Well, you, a fellow named Tom(?), and I all used to try to help folks out on another SQL forum about 6 years ago....
April 30, 2010 at 3:14 am
For 32 bit version, here are some methods used to import/export to EXCEL from SQL Server table
February 16, 2010 at 11:54 pm
It would be something like this
declare @tblcodes table(codeid int, code varchar(100), adr_id1 int)
insert into @tblcodes
select 1,' CB4560460D5946C49D9B286048CC11A7', 0 union all
select 2,' 5953BE4521634863B9D03137B7DBA3C4', 0 union all
select 3,' 97D40E6B7AF545AE94ED13DF1AF1C27F', 0
declare @tblcustomer...
January 15, 2010 at 6:43 am
Viewing 15 posts - 16 through 30 (of 314 total)