I have the below code:
'Week1' = case when checkdate = dateadd(wk,-4, '2009-9-04') then ISNULL(d.units,0) else 0 end,
'Week2' = case when checkdate = dateadd(wk,-3, '2009-9-04') then ISNULL(d.units,0) else 0 end,
'Week2' = case when checkdate = dateadd(wk,-2, '2009-9-04') then ISNULL(d.units,0)...
I am working on a report that I would like to capture totals going back 4 weeks?
For instance, I can easily capture this week's total because I can write something like this:
sum(isnull(e.AllTCHours, 0))
where weekending = '2009-8-29'...
How can I get a sum going back for the entire month of...
I have the below code:
select cd.custdeptname, costcenterdesc, weekend, 'Regular Hours' = SUM(case when t.paycodeid = 1 then ISNULL(t.units,0) else 0 end),
'Overtime 1' = SUM(case when t.paycodeid = 2 then ISNULL(t.units,0) else 0 end)--, t.paycodeid
from prchecktc r
inner join vw_tcdetailall...
I have to stored procedures that I am using to call a report:
exec udsp_getcandidateinfobyid @candidateid = {?@candidateid}
exec udsp_CandidatesSupplemental @candidateid = {?@candidateid}
how can I get these to join so I won't have to type the parameter @candidateid twice....
Please help me figure out the correct way to write the below code:
Having SUM(ARAmount) <> 0 and Having SUM(v.InvCur) <> 0 and Having SUM(v.INV30) <>0
and Having SUM(v.INV60) and Having SUM(v.INV90) <> 0 Having and SUM(v.INV120) <> 0
Thanks!!
I have the below formual:
If DayOfWeek({Command.weekending}) = 2 Then
{Command.weekending}-6
I am trying to return a date of:
2009/8/17, but it returns nothing? weekending is a datetime field, does that matter?
Please help!!
I have a situation where I have the main report data with the total amount, and I have a sub-report with monthly breakdown totals as follows:
--Main Report
1451 CORAL RIDGE AVENUE CORALVILLE 52241 $15,347.09
2345 Saulsbury Rd Muscatine 52761 $10,000.00
2403 5th Ave SE CEDAR RAPIDS...
I have the below code:
DECLARE @quarter int
DECLARE @year varchar(4)
DECLARE @idedate1 datetime
DECLARE @idedate2 datetime
DECLARE @idedate3 datetime
SET @quarter = 2
SET @year = 2008
select @idedate1 = case
when @quarter = 1 then '1/12/' + Convert(VarChar(4), @Year)...
I have the below results set:
State Qtrly Date EmpCnt
AL 2008-05-12 00:00:00.000 1
AL 2008-06-12 00:00:00.000 1
AL 2008-04-12 00:00:00.000 1
What I want the end result to look like in Crystal is:
State Month1 Month2 Month3
AL 1 1...
I have the below query:
DECLARE @StartDate datetime
SET @StartDate = '2009-7-27'
DECLARE @EndDate datetime
SET @EndDate = '2009-8-02'
select count (distinct employeeid), busunitdesc
from invinvoicedetail inv
inner join invinvoiceheader b on b.invoiceid = inv.invoiceid
inner join ssbusunit u...
I have the below fields:
HR Solutions 498
HR Solutions RTI 1,020
These are computed using the distinct count function. How can I add those 2 together to get the correct answer? I am doing a distinct count and placing it in the group footer and I am coming back with 1,513 as opposed...
I am calling a stored procedure in Crystal and I have 2 parameters: @candidateid and @typeid.
I am setting @typed = -1 or typeid = @typeid in the code. I want to hardcode @typeid = 2 in Crystal so the user won't have to enter it when running the report. Currently I have @typeid = 2 in the...
I have the below query:
Select x.intid, x.fieldid, x.extid, custid, name
from ss_hcsscsa.dbo.custcustomer mstr
LEFT OUTER JOIN integrateprod.dbo.intxref x on mstr.custid = x.extid and x.subscriberid = 2 and x.fieldid = 95
where name in (select * from ss_hcsscsa.dbo.top50clients)
group by...
I have the below formula:
SELECT DATEADD(year, -1, getdate()) - which returns:
2008-07-21 12:03:32.733
--I need it to return the time as 00:00:00.00
Also in my report what I need to accomplish is a date range:
checkdate between DATEADD(year, -1, getdate()) and 30 days(the previou 30 days)...
I have a file that I imported into Excel and the date came over as Mar 9 2007 12:00AM. If I choose format cell that doesn't put it in the 3/9/2009 format. Is there a way to accomplish this?
Thanks,
I have the below statements:
SET @QtrClose = getdate()
SELECT @QtrClose = CloseDT from prtaxperiodclose where TaxPeriodID = @Qtr and TaxPeriodYear = @Year
What I need to accomplish by combining the 2 is:
When CloseDT is null set it = getdate(), otherwise -
SELECT @QtrClose = CloseDT from...
I have a parameter @date. I want it to be setup as to where it can accept a date of it one is not passed in, it defaults to getdate(). How can I go about doing that?
Declare @date datetime
Set @date = ?????
Thanks!
I am having a mental block this afternoon. I have a result set that I want to export from Query Analyzer to a text file and I want it to have the commas inserted after each cell.
I have tried to export as a CSV, but that doesn't seem to work.
Thanks!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.