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. Draven74

    Possible to declare a variable inside a select statement?

    Thank you for the response. Sorry, I guess I wasn't completely clear. When I wrote the nested select statement 'Select B.Test3 From B', I should've actually written 'Select TOP 1 B.Test3 From B Where ...'. So unfortunately I can't use the method you provided. That's why I'm trying to use the...
  2. Draven74

    Possible to declare a variable inside a select statement?

    Hello, I've got a stored procedure that builds a dynamic SQL satement and then assigns it to a varchar variable. I would like to know if if's possible to declare a variable from within a select statement. I keep getting the 'Incorrect syntax near the keyword Declare' error. For example...
  3. Draven74

    Possible to declare a variable inside a select statement?

    Wow, another quick response...thanks Yup, you understood correctly. Funny that's actually what I had to do to make the query run, but I wanted to use the @tmp variable to avoid having to run the statement (Select B.Test3 From B) again if @tmp wasn't empty (in hopes of speeding up the query)...
  4. Draven74

    Possible to declare a variable inside a select statement?

    Thank you very much for the quick reply. Unfortunately it still doesn't work. I might not have explained the situation completely. The stored procedure is actually building a dynamic SQL satement and then assigning that to a varchar variable. So it's more like: DECLARE @myStr varchar(1000)...
  5. Draven74

    Possible to declare a variable inside a select statement?

    Hello, I would like to know if if's possible to declare a variable from within a select statement. I keep getting the 'Incorrect syntax near the keyword Declare' error. For example: SELECT A.test1, A.test2, (DECLARE @tmp INT SELECT @tmp = (SELECT B.test3 FROM B) CASE WHEN @tmp <> 0 THEN @tmp...
  6. Draven74

    Windows XP Service Pack 2 - Problem with hyperlinks

    Thank you both for your help. I tried changing the settings (firewall, etc.), but still no luck. In the end I opted to have an onclick event that calls a routine which shells the application. It's one way to get around the problem.
  7. Draven74

    Windows XP Service Pack 2 - Problem with hyperlinks

    Hello, I'm hoping someone can help me. I've got a web page that creates an excel file client side and saves it to the client's temp folder. The page then displays a hyperlink (File://...) to that file. Before SP2 there were no problems, the file would open normally, but now even though the...
  8. Draven74

    Logic Problem

    You're welcome kaylabear, Maybe you could provide me with a little more detail. What exactly do you mean by 'declared again and again'? What I was referring to would mean that you would declare the variable once, perhaps in a form_load somewhere.
  9. Draven74

    Logic Problem

    Hi, You could just do a GetSetting() and check for an error(if the registry entry was not created yet). If the entry wasn't created yet, set it to 1, otherwise add 1 to it. Basically remove the setting of the entry to 1 everytime you start the program. Let me know if that doesn't answer your...
  10. Draven74

    Force window to front in calling application only.

    Hi, Does anyone know how to force a form to the front, but only within the calling application (hopefully using the SetWindowPos API)? I have a form that is displayed showing a progress indicator (therefore I don't want the form shown modally, which would halt program execution). I want the...
  11. Draven74

    Problem sorting in MSHFLEXGRID

    Thank you all for your input. I'm trying to make this as generic as possible. I wanted to avoid using an array or collection. I'm dealing with multiple grids (each with many columns). I'm probably dreaming in technicolor, but does anyone know of a property of the MSHFLEXGRID that can return...
  12. Draven74

    Problem sorting in MSHFLEXGRID

    Hello, I'm hoping somebody can help me out. I'm using the double click event of an MSHFLEXGRID to sort a column selected by the user. I have multiple columns with different data types (dates, integers, strings). The problem is that whatever sort property I choose, it doesn't sort all data...
  13. Draven74

    VB 6 Creating an MS Excel File - Error

    Hey there, How about trying this: With objXL.ActiveWorkbook .Worksheets.Add .Worksheets(&quot;Sheet1&quot;).Name = strname End With

Part and Inventory Search

Back
Top