User Profile

Collapse

Profile Sidebar

Collapse
sayedul
sayedul
Last Activity: Mar 23 '08, 09:13 AM
Joined: Oct 8 '07
Location: Bangladesh
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi,

    I got a solution for worksheet namely '2007data' below and works fine:

    Code:
    select * from OpenDataSource
    	( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\test.xls";Extended properties=Excel 8.0')...['2007data$']
    But strange again!! Script below does not work for worksheet namely 'Sheet1' in the same way:
    Code:
    select * from OpenDataSource
    	( 'Microsoft.Jet.OLEDB.4.0',
    ...
    See more | Go to post

    Leave a comment:


  • OpenDataSource fails from worksheet name starts with a number in xls file

    Hi,

    I can access data from xls file using OpenDataSource. But if the worksheet name starts with numeric character it gives error. Scripts are as follows:

    If the worksheet name is 'Sheet1' it works fine with script below:
    Code:
    select * from OpenDataSource 
    	( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\test.xls";Extended properties=Excel 8.0')...[Sheet1$]
    But if the worksheet...
    See more | Go to post

  • sayedul
    replied to get max values
    The following will work:

    Code:
    Update TableName set Result =
    case when (case when col_1 > col_2 then col_1 else col_2 end) > col_3 then 
    (case when col_1 > col_2 then col_1 else col_2 end) else col_3 end
    ...
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Keyword Search Help
    Hi,

    I have written another very simple solution of the problem. The solution is tested. The procedure is as follows:

    Code:
    create procedure procSearch
    @TrainingCertification varchar(50) = null
    as
    begin
    select *
    from TrainingCertifications
    where (';' + replace(@TrainingCertification, '; ', ';') + ';') 
    like ('%;' + TrainingCertificationsType + ';%')
    end
    ...
    See more | Go to post

    Leave a comment:


  • Hi,

    To fulfill all the requirements of the problem, I am sure that the other solutions except mine will not work. I think the other members who gave solution did not understand the problem completely or did not test their script to solve all the cases of the problem. The problem expresses that the parameter can be any of three types i.e. null or single value or multiple values separated by comma.

    I shall be pleased if...
    See more | Go to post

    Leave a comment:


  • Hi,

    If data type of EnterpriseId is varchar/char, try with where condition like below:
    Code:
    where (','+isnull(@var,EnterpriseId)+',') like ('%,'+EnterpriseId+ ',%')
    If data type of EnterpriseId is any numeric, try with where condition like below:
    Code:
    where (','+isnull(@var,convert(varchar(20),EnterpriseId))+',') like ('%,'+convert(varchar(20),EnterpriseId)+ ',%')
    The...
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to how to concatenate in sql server
    Try this (should work):

    Code:
    select @concat = isnull(@concat,'') + @CrdPinNo
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Dynamic date setting in loops
    If you have the table like below:
    TABLE1 ([DATETIME] DATETIME)


    The modification your script to correct one as follows:

    DECLARE @K INT
    SET @K = 0
    WHILE(@K<10)
    BEGIN
    INSERT INTO TABLE1 (DATETIME) VALUES (convert(dateti me,'2007-10-26 11:'+CAST(@K AS VARCHAR)+':00') )
    SET @K=@K+1
    END
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Count Problem Urgent
    Hi,

    Try this below:

    select School, Semester, Grade, Campus,
    NoofAccepted = sum(case Status when 'Accepted' then 1 else 0 end),
    NoofRejected = sum(case Status when 'Rejected' then 1 else 0 end)
    from StudentResult
    group by School, Semester, Grade, Campus

    This is tested now and will work fine....
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Count Problem Urgent
    Hi,

    Try the sql below:

    select School, Semester, Grade, Campus, NoofAccepted = sum(case Status when 'Accepted' then 1 else 0 end),
    NoofRejected = sum(case Status when 'Rejected' then 1 else 0 end)
    from StudentResult
    group by School, Semester, Grade, Campus

    I have not tested it. Hope it will work....
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Keyword Search Help
    Hi,

    The detail of the DB solution is greate especially the select statement written in the stored procedure.

    Thanks....
    See more | Go to post

    Leave a comment:


  • sayedul
    replied to Keyword Search Help
    Hi,

    You can make a sql function with a parameter string to return a table with all the semicolon separate words as in different records. Use the function in the stored procedure. Use cursor to get different words from the table returned by the function within the stored procedure. Use the select statement for different words in cursor loop to fill a temporary table. Finally return the temporary table records. This should serve your...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...