Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: How Much Is It Worth?

    Ethics is diseased.

    Code of Ethics? Interesting topic. Does the U.S. government follow code of ethics? Shouldn't have used certain damned weapons against Iraq civilians, as Italian news agencies reported. If...

  • RE: Data transfer error

    Same machine or two? SQL Server version and service pack? OS version? Was the package done by MS DTS designer or developped otherwise? These info may help narrow down the...

  • RE: Using Update with Select

    -- try following

    UPDATE A

    SET ProductTotal = SUM(B.Productamt), DiscountTotal = SUM(B.DiscountAmt), TaxTotal = SUM(B.TaxAmount)

    FROM POSumTable A INNER JOIN ItemTable B ON A.PONo = B.PONo

    WHERE A.PONo= 23

  • RE: ANSI warnings and linked server

    Use ISNULL or CASE to replace those NULL values with 0 or '' (empty string) in your aggregate functions.

  • RE: Basic SQL

    As a general rule, table key should be unique. You may want to consider two tables instead of one. One for Client, the other for Client Data.

  • RE: Using CASE to configure result sets

    -- first query

    SELECT SD.Grade, LC.LocationDesc AS 'SchoolName', COUNT(TD.TeacherID) AS 'TeacherCount'

    FROM teacher_data_Main TD INNER JOIN tblLocation LC ON TD.SchoolNum = LC.Location2

     INNER JOIN student_data_main SD ON TD.TeacherID = SD.TeacherID

    WHERE...

  • RE: Datetime comparison

    '0700' seems 7AM to me. If yes, DATEPART(hh, @start_date_time) >= 7 may answer Q1. With regard to Q2, if you'd like to retrieve 'hh00' out of a datetime field,...

  • RE: TimeSheet - Date Time

    Beauty.

    Jonathan's code should answer shez104's request.

    Thanks

  • RE: TimeSheet - Date Time

    Try following data.

    create table Punches(FEmpId int, FTime datetime, FType varchar(3))

    insert into Punches(FEmpId, FTime, FType)

    select 210, '2004-03-03 08:59:00.000', 'IN'

    union all

    select 210, '2004-03-03 09:30:00.000', 'IN'

    union all

    select...

  • RE: TimeSheet - Date Time

    I mis-understood the question backward. Try following.

    SELECT U.FEmpId, U.FTimeIn, U.FTimeOut, U.Hours

    FROM (

     SELECT A.FEmpId, A.FTime AS 'FTimeIn',

      (SELECT TOP 1 case when B.FType = 'IN' THEN...

  • RE: TimeSheet - Date Time

    SELECT FEmpID, In AS 'FTime', 'IN' AS 'FType'

    FROM TableTimeSheet

    -- WHERE ...

    UNION ALL

    SELECT FEmpID, Out AS 'FTime', 'OUT' AS 'FType'

Viewing 12 posts - 1 through 12 (of 12 total)