Displaying 3 results from an estimated 3 matches for "datepart".
2007 Feb 20
1
Reshape (pivot) question
...2 50 ID1564267 1263 10.2.2006 15:45 2222 2 10 ID1564267 1263
10.2.200615:45
3333 3 10 ID1564269 5646 13.5.2006 17:02 3333 3 10 ID1564270 7561
13.5.200617:02
6666 1 10 ID1564271 1676 15.5.2006 20:41 2222 2 20
How can I do a new (pivot?) data.frame in R which I can achieve by MS SQL:
select eala,
datepart(month, date) as month,
datepart(year, date) as year,
count(distinct id) as id_count,
count(distinct patient_id) as patient_count,
count(distinct(case when class = 1 then code else null end)) as count_1,
count(distinct(case when class = 2 then code else null end)) as count_2,
count(distinct(ca...
2007 Apr 09
1
help with ActiveRecord joins
...es dates up to an event horizon, and I get all events on
dates in whatever range I''m looking at with a query like:
SELECT
events.*, library_dates.start_date
FROM
library_dates
LEFT OUTER JOIN events ON 1=1
WHERE events.id IN (SELECT event_id FROM recurrences WHERE
monthday IS NOT NULL AND DATEPART(dd, start_date) = monthday OR
(monthday IS NULL AND weekday IS NOT NULL AND DATEPART(dw, start_date)
= weekday AND
(monthweek IS NULL OR datepart(dd, start_date) BETWEEN
7*(monthweek-1) + 1 AND 7*(monthweek-1) + 7)
))
OR events.id IN (SELECT event_id FROM occurrences WHERE startdate =
sta...
2005 Jul 28
1
conversion from SAS
...;m still trying to do that!)
PROC IMPORT OUT= WORK.CHLA_italian
DATAFILE= "C:\Documents and
Settings\carleal\My
Documents\REBECCA\stat\sas\All&nutrients.xls"
DBMS=EXCEL2000 REPLACE;
GETNAMES=YES;
RUN;
data chla_italian;
set chla_italian;
year=year(datepart(date));
month=month(datepart(date));
run;
proc sort data=chla_italian; by station; run;
/* Check bloom for seasonal cycle outliers */
data sort_dataset;
set chla_italian;
chla=chl_a;
dayno=date-mdy(1,1,year)+1;
cos1=cos(2*3.14*dayno/365);
sin1=sin(2*3.14*dayno/365);
cos2=co...