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 SkipVought 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: *

  1. luvmy2Js

    Using Row_Number

    Nevermind, I got it!! Thanks a bunch!!
  2. luvmy2Js

    Using Row_Number

    I added that and it still didn't work? EXECUTE adm_Supplimental SELECT row_number() over (Partition By empid order by empid) as Row, k.empid, 'Job Title' = CONVERT(nvarchar, DecryptByKey(p1.[job])), 'Job Start' = CONVERT(datetime, CONVERT(nvarchar, DecryptByKey(p1.[Start Date]))), 'Grade'...
  3. luvmy2Js

    Using Row_Number

    I am trying to create a query that numbers my rows and the change of empid, it starts over.. I was looking at some blog on Row_number() but cannot seem to get it to work. Below is my current query, any suggestions would be greatly appreciated!! EXECUTE adm_Supplimental SELECT row_number()...
  4. luvmy2Js

    How to get a count by month

    I have a list of id's that I derived by creating a temp table. From that list I need to get a count by region for each month from Jan. 2009 - Dec. 2010. I am struggling getting this to work? Here is the start of my code: Create table totalemp# (empid int,geo nvarchar(50)) EXECUTE...
  5. luvmy2Js

    issue with update statement

    When I try that I get this error: Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.
  6. luvmy2Js

    issue with update statement

    Could someone please help me out? I have an update statement that I am trying to do and it keeps giving me this error: Msg 156, Level 15, State 1, Line 3 Incorrect syntax near the keyword 'CONVERT'.??? I have no clue what I am doing wrong.. Here is my code: UPDATE ystdy_PA0000 SET...
  7. luvmy2Js

    Arithmetic overflow error converting expression to data type datetime.

    All data is encrypted in the database so it has to be decrypted when extracting it out..
  8. luvmy2Js

    Arithmetic overflow error converting expression to data type datetime.

    Could someone please help me figure out how to convert the below data: '19731214' is how the date is printed from the database. I have tried: 1. CONVERT(varchar, CONVERT(datetime, CONVERT(nvarchar, DecryptByKey(a.[Birth Day])), 101), 101) But it returns the "Arithmetic overflow..." error...
  9. luvmy2Js

    Case Statements

    Oh man! Thanks for that!!
  10. luvmy2Js

    Case Statements

    Okay I added all my criteria in and took your code above and added: [One-Time Payment Plan] = Case when CONVERT(nvarchar, DecryptByKey(p15.[Wage Type])) = '4000' then 'Commission Payment' when CONVERT(nvarchar, DecryptByKey(p15.[Wage Type])) = '3030' then 'Recognition Award...
  11. luvmy2Js

    Case Statements

    I have a case statment with similar criteria's in them: Case when role = '8020' and id in (select id from exec) then 'Exec Bonus' when role = '8020' and not id in (select id from exec) then 'Monetary' Else '' end. What is happening is the ones that are not in "exec" are coming back blank...
  12. luvmy2Js

    Selecting MAX record and getting corresponding data

    Thanks a bunch I figured it out!!!
  13. luvmy2Js

    Selecting MAX record and getting corresponding data

    I have the below data and want to get the max date with all corresponding data: sapid startdate number cstctr job 500032 02/10/2010 30001450 AR01000008 10000549 500032 04/01/2009 39000345 AR01000003 10000549 500032 09/16/2009 30001380 AR01000003 10000549 500032 09/29/2008 39000345 AR01000003...
  14. luvmy2Js

    Need Help with Returning Values based on a date range

    I have a project where I need to pull back data based on 2 criterias: 1. Has more than one value in the table 2. At least one of those values fall within the range of 9/27/10-10/25/10. I have it to where it pulls "1", but now I am struggling with getting it to only pull back "2". The...
  15. luvmy2Js

    Arithmetic overflow error converting expression to data type money.

    Yes they do fall within the data type of money, however I did notice the field is in the database a "float"? Could that be the issue?
  16. luvmy2Js

    Arithmetic overflow error converting expression to data type money.

    What am I doing wrong in the below statement: CASE WHEN NOT CAST(CONVERT(nvarchar, DecryptByKey(a.[1003-Ref Salary])) as MONEY) > 0 THEN NULL WHEN NOT c.Name IS NULL THEN (a.[PP salary-Comm] * CAST(y.[Annual Conversion] as money)) ELSE (CAST(CONVERT(nvarchar, DecryptByKey(a.[1003-Ref...
  17. luvmy2Js

    Comparing data within the same table

    Thanks a million guys for all of your help on this!!
  18. luvmy2Js

    Comparing data within the same table

    What does the ";with cte as" mean? Never seen that before.. Thanks,

Part and Inventory Search

Back
Top