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

  • Users: gus121
  • Order by date
  1. gus121

    Date insert issue into SQL server DateTime field?

    Hi thanks damber, I have looked at the information you have given me. I am aware how to create a vb function. thanks Think its probably better to write a stored procedure and do the date manipulation bit within the proc therefore no need to change the Local Settings for the whole site...
  2. gus121

    Date insert issue into SQL server DateTime field?

    Hi damber, I have never heared of an inbuilt asp format function! response.write(Format(Now, "dd-mm-yyyy hh:nn:ss")) When i run this i get back. Type mismatch: 'Format' -Gus
  3. gus121

    Date insert issue into SQL server DateTime field?

    Hi DNG, I know i probably been a bit dim but i tried this as i thought Format must be a sQL command: [code] INSERT INTO offer(OfferCode, OfferPercent, OfferStartDate, OfferFinishDate, OfferDescription) VALUES ('24082005-174507',1, Format(04/08/2005 17:45:07, dd-mm-yyyy hh:nn:ss)...
  4. gus121

    Date insert issue into SQL server DateTime field?

    Hi when i run this sql i get this error The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated. The ASP ("INSERT INTO offer(OfferCode, OfferPercent, OfferStartDate, OfferFinishDate, OfferDescription) VALUES...
  5. gus121

    If variable exist then do something.. else do nothing?.

    Hi thanks for your input. I decided to declare the variable on each page instead using a include file which is attached on all pages. Thanks for your time. Kind regards Angus -Gus
  6. gus121

    If variable exist then do something.. else do nothing?.

    Hi i have a function which i am including on multiple ASP pages via an include file and is been called on multiple pages. However i wish to run a little bit of logic if a particular variable exists. however i dont want to have to go through and declare the varible on all my pages or remove the...
  7. gus121

    SQL SELECT DISTINCT ORDER BY ISSUE

    Hi thanks for all your help. Yes SearchResultID was unique not searchstr. I have solved my own issue i tryed SQLBills method but could not get it to work. So i experimented with the Group By clause. This seems to do the job for me. ie. bring back the last 10 Unique SearchStr records. SELECT...
  8. gus121

    SQL SELECT DISTINCT ORDER BY ISSUE

    Hi see this artical from microsoft http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html A SELECT … DISTINCT … ORDER BY command will generate an error if the specified ORDER BY field is not in the SELECT field list. This is my problem. thanks -Gus
  9. gus121

    SQL SELECT DISTINCT ORDER BY ISSUE

    Hi, No i get an error Invalid columm name SearchResultID?: SELECT TOP 10 * FROM (SELECT DISTINCT (SearchStr) FROM SearchResult) SearchResult WHERE (SearchBroad = 0) AND (Hits > 5) ORDER BY SearchResultID -Gus
  10. gus121

    SQL SELECT DISTINCT ORDER BY ISSUE

    Hi i wish to only display the top 10 distinct 'SearchStr'. How can i do this as i have to display the 'SearchResultid' in the Select statment to get the OrderBy to function. This is my current SQL: SELECT DISTINCT TOP 10 SearchStr, SearchResultID FROM SearchResult WHERE...
  11. gus121

    Issue calling stored proc from ASP

    Hi Sheco, Thanks for your input i swear i tryed renaming the cmd object similar to what you recommend above and it did not work yesterday. I try it again today and it works no problems. thanks Angus -Gus
  12. gus121

    Issue calling stored proc from ASP

    Hi DNG, adExecuteNoRecords just tells the database that we are not going to be returning a recordset. So dont bother getting ready the available memory to create the recordset. removing it makes no difference for this query. thanks -Gus
  13. gus121

    Issue calling stored proc from ASP

    It prints out done1 but not done2 printed in red. Any ideas why i should see done1 but not done2 on the screen Thanks response.write "done1!" 'it gets here! Set cmd = Server.CreateObject("ADODB.Command") response.write "done2!" 'it does not get here cmd.ActiveConnection = gConn...
  14. gus121

    Issue calling stored proc from ASP

    Hi i have an issue calling stored proc from ASP i can run this proc fine in Query Analyser. For some reason it wont run in my ASP. There is no error message it just wont update my table as i would expect. I have done some response.write in the code so I know its getting to this point. any...
  15. gus121

    Basic SProc Question? If Recorset Empty

    Hi Mo, thanks i will bear that in mind. For the moment that is too much work. thanks -Gus
  16. gus121

    Basic SProc Question? If Recorset Empty

    When i mean it does not function i mean it throws up an error when i run the query in the ASP. Surely this method is as good as the Count Method e.g: If EXISTS(SELECT id FROM tblname WHERE id=1) .... Else .... Compared to: SELECT @recordcount = count(id)FROM tblname WHERE id=1 If...
  17. gus121

    Basic SProc Question? If Recorset Empty

    Hi Mo, Since i put this query up i noticed that i had forgot to set nocount on. Which i normaly do as a matter of course as without setting no count on it normaly causes more problems than it is worth. However the first query using the @@rowcount still apperes to return two recordsets and...
  18. gus121

    Basic SProc Question? If Recorset Empty

    Hi thanks for your help. I tryed using the If Exists Method and this seems to work. For me neither your or my solution seems clean or an efficient way of running a query. If anyone has a cleaner leaner solution then they would be most welcome to post it. thanks -Gus
  19. gus121

    Basic SProc Question? If Recorset Empty

    Hi thanks i tryed your method but it returned two recordsets and empty recordset and a second recordset. I am running a little ASP app and i dont think it can cope easily with two recorsets. thanks -Gus
  20. gus121

    Basic SProc Question? If Recorset Empty

    I have a stored proc with a basic query which is returned as a recordset. However there are certain circumstances where the recordset may return no records. In which case i wish to execute anouther SQL db query instead. I wish to implement the 2nd query in the same stored proc how is this...

Part and Inventory Search

Back
Top