655 Posted Topics
Re: You can use the CHARINDEX function to locate the first occurrence of the character in question. Then use that number in the substring to get the length you need. Use this sample code to construct queries against your own data: [CODE]select myString, charindex('-', myString, 1) as 'Here is the position … | |
Re: Dependent on who the customer is. Reminds me of the conversation between the Young New Optometrist and the Old Veteran Optometrist... Noob: I get all the technical stuff of how to make glasses, but how much should I charge? Vet: Well, do what I do. I make the glasses, then … | |
Re: I laughed for five minutes. Even funnier were the comments after (but you have to read them all...) ![]() | |
![]() | Re: So if I understand this, you want any date/time after midnight and before 7am to report as the previous day, anything after 7am until midnight to show as current day. Sleeves rolled up... You aren't going to like this...it's ugly but it will work on SQL2000 - 2008. [CODE]select datediff(hh, … ![]() |
| |
Re: ...From thirteen originaaaaal cooooloneeees..... Gah. Thank you for dredging up that memory. :-) | |
Re: Yes, with a caveat. Need to know: 1. Is there a unique ascending key to identify each row? 2. If there is, is it numeric? 2a. Is the unique ascending key a composite key (i.e. more than one column)? 3. Is the unique ascending key uniformly populated (i.e. no gaps)? … | |
Re: Actually, you may wish to use correlated subqueries rather than inner joins. What happens if someone has no answers of a particular type? The row is not included in the result. Try this:[CODE]SELECT A.name, A.mykad, (select count(*) from customerservice B where B.id = A.id and B.Q1='Excellent') AS E, (select count(*) … | |
Re: 1. Write some software 2. Sell some copies 3. Repeat until wealthy All the rest is just details...business licenses, tax id's, banking, that vary widely from place to place and country to country and usually require lawyers somewhere. Then business locations, staffing, equipment, etc. that are pretty standard. My advice: … | |
Re: I agree with Fortinbra, to a certain extent. From a pragmatic standpoint, go with what you know best, are more comfortable with, and can deliver in a timely fashion. That being said, I try like crazy to avoid UDFs. I use them when the SQL for a single statement gets … | |
Re: I would, especially if you were going to have separate Department and Specialty entities translate to their own physical tables (for referential integrity's sake). If you don't plan to separate Specialty and Department as entities, then I wouldn't bother. Just out of curiosity, where is there a reference to the … | |
Re: Try this: [URL="http://www.databaseanswers.org/data_models/"]http://www.databaseanswers.org/data_models/[/URL] Not my site, but lots of cool stuff. | |
Re: Try this: [CODE]select propno, bldgno, unitno, convert(varchar(12), leasestartdate, 101) as leasestartdate, convert(varchar(12), effectivedate, 101) as effectivedate, sum(annualamount) from mpw1400 a inner join mpw1482 b on a.leaserecno = b.leaserecno where b.certno = 1 group by propno, bldgno, unitno, convert(varchar(12), leasestartdate, 101), convert(varchar(12), effectivedate, 101)[/CODE] It should do the trick. | |
Re: Try this: [CODE]create table dbo.myTable (myString varchar(25)) go insert into dbo.myTable (myString) values ('A1-an987389') go insert into dbo.myTable (myString) values ('B21-At081l0') go insert into dbo.myTable (myString) values ('AA1-ath01882') go -- And now for the piece de resistance... select substring(myString, 1, charindex('-', myString, 1) - 1) from dbo.myTable[/CODE] | |
Re: I'm not a PHP guy, but I do have a suggestion. Many programming languages/environments put your SQL through a grinder of sorts (called a "driver") before you can get to the target database. In many cases, when you use "reserved words" as column names, it can create issues. You may … | |
Re: You actually don't need vbscript to do this. Go to a DOS prompt and type [CODE]dir /?[/CODE]That will show you how to get a list of all the things you need. Try this:[CODE]dir *.jp* /s /b > myfiles.txt[/CODE]This will give you a list of all files (with directory information!) that … | |
Re: Just use SSIS. It is easiest. Alternative: use a linked server. You can look in BOL and read about sp_createlinkedserver. You can use this to dynamically create/destroy your link so you minimize your security window. | |
Re: This reply won't directly answer your question, but is intended as a possible workaround to at least get you going. First, you need to set up replication with one table (or a couple) using the Wizard and capture the generated SQL statements. Once you have captured that set of SQL … | |
Re: Okay, so this picture shows a variant on a old-style Chen diagram. Basically, rectangles are entities, ovals are entities, rounded rectangles are attributes, rounded rectangles with underlined words are keys, diamonds are relationships. See the "1" and "M" notations on the lines? They tell you which is the parent and … | |
Re: Sports team? Lots of examples. 1 Team (pk TeamId) 2 Player (pk PlayerId) 3 Player/Team (pk is from fk's TeamId and PlayerId plus a date, assuming you want that over time) 4 PlayerAttributeType (pk PlayerAttributeTypeId, instances include personal and position attribute types: height, weight, DOB, favorite color, etc.) 5 Player/PlayerAttributeType … | |
Re: Use a combination of convert and substring to pick off the first 5 characters, then concatenate with year. [CODE]substring(convert(char(8), getdate(), 10), 1, 5)[/CODE] | |
Re: Simple Google Search found this: [url]http://visualbasic.freetutes.com/learn-vb6-advanced/lesson4/p45.html[/url] Talks all about the Forms collection and how to use it. Specifically, look at [url]http://visualbasic.freetutes.com/learn-vb6-advanced/lesson4/p49.html[/url] Not my web site, but good reading. | |
Re: [CODE]select employee_id , employee_name, employee_designation, sum(basicpay) as TOTAL_basicpay , sum(allowances) as TOTAL_allowances from payroll where year = 2011 group by employee_id , employee_name, employee_designation [/CODE] | |
Re: Try storing an integer containing yymmddhhmm in the ItemData for each ListView entry. It's clunky but it works. Just search down the ItemData until you find the index you want, then [CODE]listview.additem "youritem", indexYouFound listview.itemdata(listview.newindex) = yymmddhhmm.[/CODE] Oh, and be sure to use 24-hr clock settings instead of 12-hr. | |
Re: You are not setting a return value. [CODE]<snip> UPDATE dbo.Member SET PW = @binarypassword WHERE ID = 'philip' if @@error = 0 --check to see if the update worked begin return(0) else return(1) -- or some other number that's meaningful to you end end[/CODE] What are you expecting to get … | |
Re: [QUOTE=bob200707;1364719]Does anyone know COBOL? I need help with a program I am doing.[/QUOTE] I did some COBOL in the 80's and 90's under DOS/VSE, MVS and VSE/ESA. Also, some MicroFocus Cobol under PC-DOS back in the day. What is your question? | |
Re: "Set" is a value assignment. Therefore it should have "=" instead of "in", like so: [CODE]SET @item = (SELECT itemtypeid FROM laitemtype WHERE itemtypeid LIKE '88BBA7AD-BD25-E011-94E0-001B214A75A5')[/CODE] However, if you get more than one itemtypeid that meets the criteria, you'll get an error. That being said, I'm still not sure what … | |
Re: What version of SQL Server are you using? I tried this code on SQL2000, 2005 and 2008 and it worked in every case. [CODE]create table interiors ( id integer, name varchar(20), type varchar(20) default 'baby cot', price integer ) go insert into interiors (id, name, price) values (1, 'Using Default', … | |
Re: Dr. Dobbs' Journal, [url]http://www.drdobbs.com/index.jhtml[/url] or Ars Technica [url]http://arstechnica.com/[/url] are pretty good. | |
Re: Very ambitious. Have you designed games in other languages before? The reason I ask is that you should probably get a more general overview of Game programming prior to tackling doing it in asm. What I've found is that most game developers will storyboard their game, get some artwork going, … | |
Re: [CODE] <snip> WHILE @@FETCH_STATUS = 0 BEGIN SET @fileName = @path + @name + '_' + @fileDate + '.BAK' BACKUP DATABASE @name TO DISK = @fileName [COLOR="Red"]WITH DIFFERENTIAL[/COLOR] FETCH NEXT FROM db_cursor INTO @name END </snip>[/CODE] The trick is that @fileName has to already exist. How you get that filename … | |
Re: This may seem a little vague to you, but stay with me. 1. One major question is DBMS dependent. If it's MSSQL: are you familiar with JOIN syntax? If it is (MSSQL), and you are not (familiar with JOIN syntax), then you need to study that to be able to … | |
Re: Not sure if this is what you're looking for, but here goes: (since you're using Martin symbols, I'll try to keep my nomenclature in that methodology) 1. Not seeing any cardinality on relationships, just lines and "crowsfeet". For instance, if there must be at least 10 staff members and at … | |
Re: You can actually run your DTS packages under SQL2005 and 2008...There should be a node in the tree in Management Studio that says "Management", under that is "Legacy". Under that you should see another node "Data Transformation Services"...right click on it and you'll that has a Migration Wizard. It sucks, … | |
Re: The second two are pretty easy. The first one, I think your expectation is inaccurate. I'll explain at the end after we tackle the second two. For selecting "most kids", keep in mind that you only retrieve the columns you list. So unless you include "name" in the select list … | |
Re: If you are looking for a subject area for your project rather than a recommendation for which DBMS software to choose, try these steps: 1. Think of the things around you that you want to keep track of or keep organized. Bills you pay? Books or music you own? Vehicle … | |
Re: To begin with, SAP isn't really a "database". It's an app framework that stores its data and some of its processes inside an actual DBMS such as Oracle or MS SQL Server. You can create "z tables" in SAP but they're not really tables per se. It's an important distinction. … | |
Re: If you're just starting out, you may find this tutorial page helpful. I know I did. [url]http://www.winprog.org/tutorial/[/url] Good luck! | |
Re: How about SETI? They have an interesting model where people at home donate their cpu cycles/bandwidth to help with the Search for Extraterrestrial Life. Or, if you're looking for something more historic/"old school", Sabre would be a good one...it is the old airline ticket reservation system, managing all US domestic … | |
Re: Well, this can be answered in several different ways. The first and foremost question is, are they willing to spend money? This may seem a cavalier thing to ask, but it encompasses many subjects: 1. How big is the business? 2. How many users? 3. How much business volume? 4. … | |
Re: Personally, when I was in your position, I chose nasm (because it's free :-)) and went from there. You can find the download and other resources at [url]http://www.nasm.us/[/url] If you choose another assembler, follow the same basic steps...then read, read, read. For some great assembler tutorials, go to Pete's QuickBasic … | |
Re: For the cursors, this looks like a scoping issue. Whenever you create dynamic SQL and execute it, you're creating an "inside" scope. You can't reference anything temporary (your cursor declaration) INSIDE the scope of your exec statement from OUTSIDE it's scope. There is an analogy where you try to create … | |
Re: Are you using SQL2008 Management studio? If so, run your query, results to grid, then click on the upper-left square to select the entire grid, right click on the upper left square and choose "Save Results As...". It will give you several possibilities, including (default) .CSV and .TXT (tab delimited). | |
Re: My $.02: Yes, SQL Server does care about using reserved words...sometimes. ;-) However, you can get by potential problems of this sort by enclosing the offending reserved word in square brackets, so [GROUP] would be acceptable. However, to further hint that you're using the reserved word as a database object, … | |
Re: First things first...if you're using integrated security, did you add the users' NT logins to SQL Server and give them permissions to your database? If not then all connections will be denied except for the database owner or SA. You may consider creating an Active Directory Group and add all … | |
Re: "Hot" is such a subjective term. It really depends on what industry you want to target. If you're just looking for a job doing general IT business computing, I hate to break it to you but most of your jobs are going to deal with MS to some degree or … | |
Re: The flippant answer would be "Sure, you can do anything you want...but WHY?". A more serious answer would be: 1. IF you are talking about a UML class diagram, you might consider having the Student class containing collections of the other classes as attributes, rather than sub-classing. The whole idea … | |
Re: My answer to your question is yes, your approach makes sense. Interestingly, the concept you've come up with is analagous to the old accounting principle of a "suspense" account. The idea is that you want to make sure you aren't spending money twice, so you set it aside ("suspend" it) … | |
Re: I like the way you're going with this, but I do have one suggestion. On the "Answers" table, you might consider having a single variable length string to hold any kind of answer, then a separate type column to say how to decode the answer. So, if you got a … |
The End.