655 Posted Topics
Re: I believe line 4 should be a concatenation like so: Shell "cmd.exe /c " & command Not sure if your command will execute, but at least the Shell part will be right. Good luck! | |
![]() | Re: Yes, there is a handy little function called "LOWER()" and it's sister function "UPPER()" that can be used to change the case of character data. So you'd do something like: select lower(pName) as PageName from dbo.Pages That will change every upper-case character in the string to lower-case. Hope that helps. … |
Re: The problem is that a PIVOT clause can only provide aggregations on a base column, not on a calculated or aggregated column alias. Try this. After line 98, add the clause "into #temp1" to push the results into a temp table. Then, after line 129, put the following: select * … | |
Re: It depends on your database engine. What DBMS are you using? | |
Re: Cascading delete is something that you set up when you are creating your referential integrity constraints. If it isn't set up, you have to alter your constraint to include the clause "ON DELETE CASCADE". Look in the SQL Help system, and search using the term "table_constraint". It has full syntax … | |
Re: You can't really mix-and-match declarative join syntax with explicit join syntax. So, for instance, you'd have to have each table joined to each other table like so: ... from demographics inner join IndexPID on IndexPID.NDoc_Number = Demographics.NDoc_Number inner join PatientSupply on PatientSupply.NDocNum = Demographics.NDoc_Number ... or like this: ... FROM … | |
Re: From the help system, "ADO Error Codes": *adErrInvalidConnection 3709 0x800A0E7D The application requested an operation on an object with a reference to a closed or invalid Connection object. * So that tells me you have either a) not properly opened your connection object (but we can't see what's in the … | |
Re: Not sure exactly what you're asking for here. "Best" is sort of context-dependent. If you just want a common connection string, make a module-level or global variable to hold the value you want. Usually, it is of the form: Global Const ConnectionString = "provider = microsoft.jet.oledb.4.0;data source = c:\working\db1.mdb" where … | |
Re: A man and his friend were hunting in the woods. They weren't having any luck finding anything, so the friend suggested they split up. So the man bumbled through the thickest part of the forest and eventually came upon a sunny meadow. In the middle of the meadow was a … | |
Re: This little query ought to get you what you want: select t1.location, t1.custnum from #temp t1 left join #temp t2 on t1.location = t2.location and t1.custnum = t2.custnum and t1.driver <> t2.driver where t1.driver = 'dwcustcomm' and t2.driver is null You could always change it to "select distinct blah.blah..." if … | |
Re: After reading the original request, I wonder if the OP is really asking for: "How would I COUNT the NUMBER of negative numbers in a listbox" rather than "ADDING UP the total of the numbers in the list, regardless of whether they are positive or negative". Might be something like … | |
Re: You are trying to set the variable "con" to be a new connection. It is defined as a Recordset object. | |
Re: Your request is a bit confusing. You appear to be asking for several different things, each of which should require it's own statement or stored proc. Your scenario needs further explanation. For example, is your Event table used like a transaction to pass forward and trigger some action, or is … | |
Re: Llama Fossil Antidisestablishmentarianism | |
Re: First, allow me to express my sympathy at losing a co-worker. Regardless whether he was your friend or associate, it is always a blow to a department or organization. On to technical stuff: It appears that if he passes a number other than zero as the parameter, it clears only … | |
Re: Could be any number of scenarios. Three examples are above, but there are others: 1. Input is always sequential or unordered, you could use a flat file. 2. Output is unordered or chronological, you could use a flat file. 3. Input is streamed or random, use a service endpoint. 4. … | |
Re: You probably won't get any help until you supply more specifics. You are not supplying nearly enough detail for us to evaluate your situation. | |
Re: The problem is that your primary key in ProductTrans consists of TWO columns, not one. Therefore, you either have to change your foreign key references in CustomerValue to point to Product and to Sprint, or you need to combine them into a single constraint pointing to ProductTrans with both columns. | |
Re: You kind of have to do this in two parts. First, select data from the two tables into a temp table, then use the temp table to select and sort Try this: select '1' as tblName, ContactPersonId, [Name] into #temp1 -- here is where the temp table is created from … | |
Re: Q: How many programmers does it take to change a light bulb? A: Can't do it...it's a hardware problem. | |
Re: I ran this test code and it seemed to work fine: Sub fred() Dim wb1 As New Excel.Workbook Set wb1 = ActiveWorkbook wb1.ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Select End Sub It seemed to work for me. How are you instantiating the wb1 variable? | |
Re: The closest you're going to get is with a system stored proc called sp_testlinkedserver. Use the following snippet to do what you need: BEGIN TRY exec sp_testlinkedserver BKP01 print @@error PRINT 'DBName available.' END TRY BEGIN CATCH print @@error PRINT 'DBName not available.' END CATCH This should at least get … | |
Re: Short of dropping/recreating the table, the only way to reset the identity values is to issue a TRUNCATE statement. Then the identity value for identity column for that table will reset to the seed value specified at create time. Keep in mind that TRUNCATE gets rid of ALL the rows. … | |
Re: If you want them just building web pages, then PHP is fine. But if you want them to be PROGRAMMERS, I think you can't go wrong with QuickBasic (you can still find v4.5 online). It doesn't require them to be computer scientists to start, and gives them lots of room … | |
Re: Actuall, @ChrisHunter, putting a GO in between the statements will separate batches so you'll just lose your variable declarations. Try it. To the OP, you're not giving us a lot of information. What is the error you get? Which statement is erroring? Can we assume the dbo.getCombinedDateTime is a user-defined … | |
Re: I assumed that you wanted each new order number to start with line number 1 like so: 12345-1 12345-2 12345-3 23456-1 23456-2 etc. After playing a little fast and loose with your sample query and test data, here's what I came up with: [CODE]select cast(ord.orderNumber as varchar(5)) + '-' + … | |
Re: Couple of things. 1. You shouldn't have to create a database prior to doing your restore. 2. If you HAVE created a database, run the restore command with a "WITH REPLACE" in addition to your "MOVE" clauses, like so: restore database db203021561 from disk='c:\temp\db203021561.bak' with replace, move 'db203021561' to 'c:\temp\db203021561.mdf', … | |
Re: "Be kind to your staff...you never know but that you might wind up working for them someday!" (And yes, this actually did happen to me) | |
Re: Interesting...I googled your question and found this: [URL="http://stackoverflow.com/questions/6037501/sql-data-hierarchy"]http://stackoverflow.com/questions/6037501/sql-data-hierarchy[/URL] It appears you got an answer to this yesterday at a different web site. Why are you posting the same question here? | |
Re: Or, depending on what database you're using and how fancy you want to get, you can use ODBC or OLEDB connectivity to connect to your database server. | |
Re: I was going to be sarcastic and tell you to use google to look for 'best "best lists"'. Then I actually did that...and it turns out there are HUNDREDS of them. So should I google for "best 'best "best lists"' lists"? I think I just punked myself. My head is … | |
Re: Could be any number of things causing it. Not knowing your table structures or your data volumes, I can only recommend generic things to try, such as: 1. Are your tables indexed? If not, you might try indexing them. 2. Are your tables volatile? As in, lots of random inserts/updates? … | |
Re: To expand on @JorgeM's idea, you might also consider wrapping all the updates inside a transaction to ensure that you can rollback if there are problems with one of the updates. | |
Re: Also, you have to put actual global variables in a Module, not in a Form. Your best bet is to alter your project to use Startup Object "Sub Main" rather than a form. To do that, create a module, put in a subroutine named "main" that loads your initial form, … | |
Re: Sorry, we don't just hand you code on request. If you've already tried something and it doesn't work, post that and we can help you fix it. | |
Re: I was not able to duplicate your error. More detail on your scenario is necessary. What are the datatypes of the columns? What are the join criteria? Are there selection criteria being used when you execute? What version of SQL Server are you using? How about some sample data? | |
Re: I started coding professionally with COBOL in 1984. Since that time I've learned a few other languages (about 17) and other platforms/technologies to try and stay relevant (and employed :D) | |
Re: I sort of agree with @debasisdas...seems like your approach is overly complicated. However, if you are determined to do it the way you want to do it, try this: Every time you click on one of the labels, store its name in the form's Tag property. Then, when you click … | |
Re: QWERTY...until I can get the USB port surgically installed in the back of my neck. :-) | |
Re: If I'm not badly mistaken, it appears you guys are all missing the OP's point here. If I may make an assumption or two here, it appears that there is no "patient" table...there are TWO "patient" tables...one for InPatients and one for OutPatients. And, they don't relate to each other … | |
Re: What have you already tried? We don't usually provide detailed help if you don't show any effort first. However, I'm feeling charitable today, so I can point you in the right direction. Depending on when you want to display information (as in "When the mouse gets there" or "When the … | |
Re: OP = "Original Poster"...the person who started the thread. | |
Re: Your best bet is to use SSIS to import the spreadsheet into a work table (not a temp table!) and execute the update join from there as an "Execute SQL Task". Maybe something like this: ~~~ mssql update a set a.newproductcode = b.newproductcode from dbo.product a inner join dbo.wkProduct b … | |
Re: You can't assume that the autoincrementing ID's will match up, so I'm pretty sure @Hearth's solution would not get the desired results. It might be useful to know more about your source table. Is there a unique natural key to use? If so, you could LEFT JOIN to Portfolio on … | |
Re: Change your fourth line to look like this: set @sqlstring = 'use ' + @DB + '(select * from Address where Customer like ''%''''%'')' Notice that there are now four single-quotes between the percent-signs. I tested this in SQL2005 Standard Edition, but it should also work with Developer Edition. | |
Re: UML is the acronym for Unified Modeling Language. It is a set of diagrams and supporting text used to represent how an automated system should behave. It is based on the merging of the work of three different OO methodologists: Grady Booch, Jim Rumbaugh and Ivar Jacobsen. Each of them … | |
Re: It looks like the code tags parser is doing funny stuff with VB code. Check out the code I posted in this thread: http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/417632/need-urgent-help Specifically, when a single-quote is used to include a comment at the end of a code line, the parser seems to erroneously highlight the following line … | |
Re: My guess is that your final SQLString has an extra "AND" after all the selection criteria. So, when you concatenate the " order by" to the end, you wind up with "...myCriterion1 = 'A' and myCriterion2 = 'B' and order by Policy_No". You'll need to strip off the last "and" … | |
Re: What have you tried already? Actually, I also wanted to say that in order to get any help at all, you need to supply a LOT more detail about your data structures, your data, and your expected result. Example: What are the datatypes of the columns? What are the constraints … |
The End.