Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: luvmy2kids
  • Content: Threads
  • Order by date
  1. luvmy2kids

    Eliminating field in group by clause

    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)...
  2. luvmy2kids

    Rolling 4 Weeks Total

    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...
  3. luvmy2kids

    Grouping based on count

    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...
  4. luvmy2kids

    Joining On Paramaters

    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....
  5. luvmy2kids

    HAVING Claus

    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!!
  6. luvmy2kids

    Date Formual to return Specific date of the Week

    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!!
  7. luvmy2kids

    Passing Number from Sub-Report to Main Report

    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...
  8. luvmy2kids

    Returning Data Set in Correct Order

    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)...
  9. luvmy2kids

    Creating formula based on part of date being passed in

    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...
  10. luvmy2kids

    Adding Group Columns

    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...
  11. luvmy2kids

    Summing Distinct Counts

    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...
  12. luvmy2kids

    Hardcoding parameter in Crystal

    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...
  13. luvmy2kids

    Error: Only one expression can be specified......

    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...
  14. luvmy2kids

    DateAdd Function

    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)...
  15. luvmy2kids

    Formatting Cell in Excel

    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,
  16. luvmy2kids

    Combining to criterias into one Case Statement

    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...
  17. luvmy2kids

    Parameter Field

    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!
  18. luvmy2kids

    Printing mm/yyyy from a date field

    How can I get the date field to only print the mm/yyyy as opposed to the entire date? Thanks!
  19. luvmy2kids

    Last7Days Function

    Could someone please tell me why this will not work: {Command.Invoice Date} in Last7Days This is a datetime field. Thanks!
  20. luvmy2kids

    Exporting to text with Commas

    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!!

Part and Inventory Search

Back
Top