Viewing 15 posts - 856 through 870 (of 2,452 total)
hexdecimal1989 (3/20/2016)
For some reason, when I Post a reply, it gone away.Please find this dropbox link:
Thanks!
your dropbox script doesnt contain Employee table....which I beleive is required
March 20, 2016 at 8:31 am
rootfixxxer (3/19/2016)
UNION ALL
SELECT 1,3,'P1',3
UNION ALL
SELECT 1,3,'P2',4
UNION ALL
SELECT 1,3,'END',7
UNION ALL
SELECT 2,3,'P1',1
UNION ALL
SELECT 2,3,'P2',3
UNION ALL
SELECT 2,3,'END',9
Then using your code, with the order by
SELECT ...
March 20, 2016 at 4:38 am
rootfixxxer (3/19/2016)
ThanksBut that doesn't work weel, because the rows must be order by time sofar, and the number 2 will have less time because it haven't completed the second stage...
so...
March 19, 2016 at 12:50 pm
try this for starters
SELECT Num, MAX(CASE WHEN stage = 1 THEN timespent ELSE 0 END) AS s1,
...
March 19, 2016 at 10:11 am
rootfixxxer (3/19/2016)
With the test data, after stage 2, with a total of 4 stages, should be:
1 | 10 | 15 | - | -...
March 19, 2016 at 9:36 am
Sample:
Athlete | Stage 1 | Stage 2 | ... | Total
Name1 | 10 | 7 | .... | 17
Name2 | 07 | DNF | ... |7
for clarification....is the above...
March 19, 2016 at 9:19 am
sample data and expected results would help please.
students under 6 on 1st jan could be something like this
select yadda, yadda from whatever where yourdate <= dateadd(yy, datediff(yy, 0,...
March 14, 2016 at 9:28 am
have you got the TSQL for your age calculations.....or is this part of your question?
some sample create table/insert data scripts and expected results will probably help
March 12, 2016 at 4:20 pm
.....me thinks you maybe comparing a "date" with a "datetime"....(what datatype is "clockin"?) :::: edit...see Ed has already mentioned this
maybe
IF (SELECT COUNT(*) FROM dbo.Clock WHERE convert(date,ClockIn) = convert(date,getdate()) AND...
March 12, 2016 at 8:01 am
just came across this....seems quite similar, but states MySQL
http://stackoverflow.com/questions/35917478/find-difference-between-two-records-in-mysql
March 12, 2016 at 7:20 am
hardik-1087613 (3/12/2016)
Sorry i forgot to mention that i need to set Date wise In-Out Details. As per attachment. Also i added some entries in your given code....
March 12, 2016 at 4:56 am
SQL!$@w$0ME (3/12/2016)
Thanks a lot Alan! Will the update also fails if an empty string is passed?
suggest you try it 🙂
UPDATE #yourtable
SET c4 = ''
March 12, 2016 at 4:31 am
well I am going to guess that it really isnt as simple as your sample data.......but as a start to the discussion, see below
USE tempdb
GO
--DROP TABLE yourtable;
CREATE TABLE yourtable(
...
March 12, 2016 at 4:20 am
ok....please read
http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/
then post back with create table statements, sample data and expected results as shown above.
March 12, 2016 at 3:37 am
looking at your table definition, it would seem that you are not using MS SQL...(.MySQL maybe?)
this site is for Microsoft SQL predominately ....you may find you get better answers in...
March 12, 2016 at 3:11 am
Viewing 15 posts - 856 through 870 (of 2,452 total)