655 Posted Topics

Member Avatar for Mike Bishop

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 …

Member Avatar for BitBlt
0
152
Member Avatar for skald89

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 …

Member Avatar for BitBlt
0
240
Member Avatar for Momerath

I laughed for five minutes. Even funnier were the comments after (but you have to read them all...)

Member Avatar for iamthwee
1
67
Member Avatar for Appienator

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, …

Member Avatar for Appienator
0
245
Member Avatar for ndeniche
Member Avatar for The Dude

...From thirteen originaaaaal cooooloneeees..... Gah. Thank you for dredging up that memory. :-)

Member Avatar for e-papa
0
90
Member Avatar for moone009

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)? …

Member Avatar for Fortinbra
0
101
Member Avatar for ukfreak

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(*) …

Member Avatar for BitBlt
0
717
Member Avatar for lucabrasi

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

Member Avatar for BitBlt
0
242
Member Avatar for gspeedtech

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 …

Member Avatar for Fortinbra
0
234
Member Avatar for kay21

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 …

Member Avatar for kay21
0
288
Member Avatar for 54uydf

Try this: [URL="http://www.databaseanswers.org/data_models/"]http://www.databaseanswers.org/data_models/[/URL] Not my site, but lots of cool stuff.

Member Avatar for BitBlt
0
143
Member Avatar for Fentontech

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.

Member Avatar for Fentontech
0
181
Member Avatar for Mike Bishop

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]

Member Avatar for BitBlt
0
105
Member Avatar for pallavibhoite

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 …

Member Avatar for BitBlt
0
104
Member Avatar for darkelflemurian

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 …

Member Avatar for debasisdas
0
356
Member Avatar for Arjun_Sarankulu

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.

Member Avatar for BitBlt
0
179
Member Avatar for KirstyHunter

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 …

Member Avatar for KirstyHunter
0
1K
Member Avatar for cinnamonsui

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 …

Member Avatar for cinnamonsui
0
228
Member Avatar for Wakesta

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 …

Member Avatar for debasisdas
0
95
Member Avatar for agr8lemon

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]

Member Avatar for agr8lemon
0
167
Member Avatar for PinoyDev

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.

Member Avatar for PinoyDev
0
268
Member Avatar for jazzyb

[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]

Member Avatar for BitBlt
0
193
Member Avatar for crazycat503

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.

Member Avatar for AndreRet
0
116
Member Avatar for Thong_Ispector
Member Avatar for lttleastig

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 …

Member Avatar for BitBlt
0
178
Member Avatar for bob200707

[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?

Member Avatar for WaltP
0
156
Member Avatar for moone009

"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 …

Member Avatar for BitBlt
0
136
Member Avatar for deolalkar_pooja

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', …

Member Avatar for BitBlt
0
107
Member Avatar for dspjm

Dr. Dobbs' Journal, [url]http://www.drdobbs.com/index.jhtml[/url] or Ars Technica [url]http://arstechnica.com/[/url] are pretty good.

Member Avatar for dspjm
0
83
Member Avatar for spoonlicker

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, …

Member Avatar for Goalatio
0
235
Member Avatar for moone009

[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 …

Member Avatar for BitBlt
0
121
Member Avatar for C++ Beginner

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 …

Member Avatar for C++ Beginner
0
91
Member Avatar for insanepenguin

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 …

Member Avatar for BitBlt
0
468
Member Avatar for vsmash

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, …

Member Avatar for vsmash
0
212
Member Avatar for jimbob90

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 …

Member Avatar for BitBlt
0
104
Member Avatar for Wakas

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 …

Member Avatar for BitBlt
0
115
Member Avatar for bl@ck_d3ath-v2

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

Member Avatar for rolandsmokit
0
190
Member Avatar for pseudorandom21

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!

Member Avatar for BitBlt
0
159
Member Avatar for threwup

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 …

Member Avatar for BitBlt
0
68
Member Avatar for tommy123

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

Member Avatar for BitBlt
0
87
Member Avatar for davetheant

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 …

Member Avatar for BitBlt
0
296
Member Avatar for azharrumani09

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 …

Member Avatar for BitBlt
0
220
Member Avatar for gmark@svs.com

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

Member Avatar for BitBlt
0
236
Member Avatar for Suzukaze

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, …

Member Avatar for BitBlt
0
116
Member Avatar for jlivvers

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 …

Member Avatar for BitBlt
0
208
Member Avatar for mongo308

"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 …

Member Avatar for BitBlt
-1
145
Member Avatar for mickymouse1

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 …

Member Avatar for BitBlt
0
107
Member Avatar for Makolyte

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) …

Member Avatar for BitBlt
0
130
Member Avatar for sbrett

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 …

Member Avatar for BitBlt
0
1K

The End.