655 Posted Topics
Re: Correct syntax on that kind of insert statement looks like this: [CODE]INSERT INTO Customers (customer_id, first_name, last_name) VALUES (1,'Barack','Obama'), VALUES (2,'George','Bush'), VALUES (3,'Bill','Clinton') GO[/CODE]You have to include the column names that you are using in the insert. | |
Re: Depending on what you've copied you can use the statement "Clipboard.GetText" or "Clipboard.GetData". You can interrogate the format of the clipboard contents by using the "Clipboard.GetFormat" method. This will tell you whether you have (for example) text, a graphic or some other kind of information in the clipboard. For specific … | |
Today I celebrate my one year anniversary of joining DaniWeb. It has been lots of fun, challenging, and (I hope) helpful to some folks. I look forward to many more years contributing! Regards, Rick (a.k.a BitBlockTransfer a.k.a. BitBlt) | |
Re: There are actually two ways to do this, but one of the solutions may not be applicable in your case. First example, you could just use this query:[CODE]UPDATE DATA1 SET [column] = CASE WHEN TIME = 0 THEN X WHEN TIME = 1 THEN y WHEN TIME = 2 THEN … | |
Re: Assuming your database is hosted on a MS SQL Server, the % sign is used as a wildcard character in the "LIKE" clause. So if you have select * from myTable where name like '%smi%' You would get "Joe [COLOR="Red"]Smi[/COLOR]th", "Ja[COLOR="red"]smi[/COLOR]ne Jones" "[COLOR="red"]Smi[/COLOR]ling Dave" and so on. | |
Re: Tricky one. I was able to use a combination of CASE, PATINDEX and REPLACE to solve this. Here's a sample script to demonstrate. It isn't pretty, but it works: [CODE]/* First, a test table to select from... */ create table #temp (id int identity(1, 1) not null, myString varchar(100)) /* … | |
Re: For your particular scenario, SQL Server will properly evaluate a single quote if you put two quotes in a row like so: [CODE]Select * from Category where MDelete =0 And CategoryName Like '%l''atelier%'[/CODE]I suggest that you use some sort of REPLACE function in your code that will replace any occurrence … | |
Re: Sorry, we won't do your work for you. We assist if you get stuck. You need to show some effort. Perhaps if you do some research, try some code, then post it if you run into trouble, you might get more response. | |
Re: None. The only difference is where the data resides (so probably the IP addresses and DNS names of the servers are different). Don't believe the hype. "Cloud" is not magic, it's just remote hosting. | |
Re: As a starter, you might consider separating your logic by testing the inputs first and waiting to do your calculations and shape-color-changing for later in the routine. Simple test:[CODE]If Not (UCase(Text1.Text) Like "[QDN]") Then MsgBox "INVALID COIN!PLEASE INSERT COIN in Q,D and N ONLY!", vbCritical, "INSERT COIN" Exit Sub End … | |
Re: [QUOTE=happygeek;1600484]If this is an Apple-style leak then there should be plenty of totally unsubstantiated rumor to follow. I've heard first prize will be an iPad 3:)[/QUOTE] That's the best thing about Apple-style leaks! Omnia possibilia sunt! | |
Re: I am working on an on-call coverage plan for the holidays. Whee. :yawn: | |
Re: I won't presume to know enough about your specific situation to give you specific advice. What I will offer is other scenarios. Choose the one that makes sense to you. A floor sweeper, as you have mentioned, charges by the hour. He automatically limits the amount he can earn by … | |
Re: Heard this one on TV many years ago, but don't remember where: Your mama's so fat, when she sits around the house, she sits AROUND the HOUSE. | |
Re: Can you post a more complete scenario (i.e. more sample data, a complete SQL statement, etc.) to work with? Just with what you've posted I did a little test and it worked fine for me. | |
Re: Shouldn't be any issue...it's just a string. Can you post the actual code thats having issues? What kind of data control are you using? What version of MSAccess? More details, please. | |
Re: Try this: [CODE]Private Sub Command2_Click() Dim a As Integer Dim f As Integer ' <--- note new variable declaration a = InputBox("put values") f = 1 ' <---- note the variable initialization factSub a, f ' <---- here is the subroutine call Print "factorial =" + CStr(f) ' <---- note … | |
Re: Depends on how you want to see it. Simplest would be to just take the report.txt file, open it, line input it, then dump it into a textbox. Of course, there's the whole size limit thing to worry about. Next possibility is to have a "Preview" button that creates the … | |
Re: Not knowing what your table structures are, or what your data looks like, I can only give generic advice, or things to look for. 1. Using "select *" will bring back every column from a table. You can increase speed by only bringing back the columns you actually need. 2. … | |
Re: One possibility is to add columns to your source table, then parse and store the node numbers separately. Then it becomes easy to query. However, that isn't always possible so here is an alternative. Writing this one was fun and horrifying at the same time. The following set of statements … | |
Re: This is not a coding-for-hire site. We try to help those who are stuck with coding problems. If you have some code you've tried, post it. Otherwise, do some work first and we'll help you if you get bogged down. | |
Re: Whew! This was a fun one. @adam_k, I tried your solution (after minor correction) and (alas) it didn't work. Part of the problem is that there are different row counts in each table, and so when you specify that each must join to the others, it doesn't have a row … | |
Re: I hope I understood what your desired result set looks like...it's the second group of two-rows? Lines 44 and 45? Anyway this query will produce that for your limited test data. No promises for the general data population. Maybe it will give you some ideas? [CODE]SELECT p.ESN ,max(returndate) as ReturnDate … | |
Re: You can't install it on a desktop. Read [URL="http://social.msdn.microsoft.com/Forums/en/sqlsetupandupgrade/thread/88d12f80-1191-4af7-8e2d-0b9f04ae3029"]this link: [/URL] | |
Re: If you had some way of grouping the rows (such as a date?) you could use a PIVOT construct. However, based on your example data, I don't see any relationship of how you could reasonably show both LC and TE. Here's what I mean...look at this scenario: [CODE=text]Code Amount Expenditure … | |
Re: If I may be so bold, it looks like you are trying to get PRIOR month quantity and compare to CURRENT month quantity, but your example data is misleading (as in, it implies a relationship between the rows you show). I think the complexity arises because you are trying to … | |
Re: This is probably really late and you may have already figured this out, but here goes:[CODE]; with tTemp as ( SELECT PARSENAME(CBuild,2) as BuildType, CompleteTime FROM [PerfData].[dbo].[Perf_PageChangeData] WHERE (RunId = 949 OR RunId = 966 OR RunId = 992 OR RunId=1055 OR RunId = 1093 OR RunId=1121 OR RunId=1129 OR … | |
Re: Yes, they are incorrect. All the parameters in your function declarations should be datatype "Long". All your local variables should probably be datatype "Long" just to be safe. Line 25 should be [CODE]SendMessage[COLOR="Red"]Str[/COLOR](windowHandles(9), LB_ADDSTRING, 0&, sItemText)[/CODE]Since the wParam parameter for the LB_SETITEMDATA is supposed to be the zero-based index for … | |
Re: You might consider browsing this forum to look at some of the responses to the hundreds of other similar requests. There are some good ideas. ...and you might get a chuckle out of some of the (not-so-polite) requests and responses. Good luck! | |
Re: Yes, although I think you'd be better off writing it as a recursive function, since it does no updating and returns a single literal value. Not only that, but you can embed it into select statements for any table (even for multiple columns in the same select statement) and not … | |
Re: Without knowing more about your data, and the datatypes of the columns, and what you're expecting to get, this is impossible to answer. However, you could look at some things that might point you in the right direction. 1. Are the datatypes correctly matching the datatypes of you selection criteria … | |
Re: @adam_k's advice is IMHO correct for small-scale apps. This scenario is a data administrator's nightmare called a fuzzy relation. It's not really a relation at all strictly speaking. It depends on evaluating values in order to establish relevance to a set. It doesn't really belong in your data structure, and … | |
Re: There are a couple of ways to do this. First and ugliest is to ReDim your array, then reload it from your list box. That way you can ensure that there are always as many items in the array as in the listbox. You do have to beware of the … | |
Re: Some versions of VB (including VBS, I believe) allow you to specify double quotes within a string by simply putting two double-quotes together like so: [CODE]dim output, txt txt = "<test name=""My Name is Rick"" value=""False""/>" output = Replace(txt, "False", "True") msgbox(output)[/CODE]So, your line 11 above can be corrected like … | |
Re: I'm fairly certain that you have to put the "SET" clause before the "WHERE" clause. That's fairly standard SQL syntax, even MSAccess SQL. Here's some sample syntax that you can adapt to your specific situation: [CODE=SQL]UPDATE MyTable SET MyTable.MyNumeric = 100 WHERE (((MyTable.MyCharacter)="One")) OR (((MyTable.MyCharacter)="Two"));[/CODE] One other little thing...on line … | |
Re: You have an extra open-parenthesis on line 3. Or, depending on what you mean in your query, a missing close-parenthesis at the end of line 12. Also, just for clarity's sake, you may want to rethink the over-used alias "s" you use in lines 4, 7 and 9. You could … | |
Re: Sort of. There are several datetime system functions common to prior releases of SQL Server. [I]GetDate()[/I] gives local date/time. [I]GetUTCDate()[/I] gives GMT. You can then use datediff to find the hour difference between them to give you the offset, like so: [CODE]select datediff(hh, getutcdate(), getdate())[/CODE]So for me here in California, … | |
Re: Part of the problem (as I understand it, and sorry if I misinterpreted) is that the Quantity Contract is related to the Customer first. Therefore, if you want referential integrity between tblPurchaseOrder and tblQuantityContract, you have to either have a nullable foreign key into tblPurchaseOrder from tblQuantityContract, or you have … | |
Re: This is not a subject for the faint of heart, and it's not something you can just "cookbook" on a forum web site. There are several different methods. You can use Replication (the "Publish/Subscribe" model), you can use linked servers, you can do log-shipping, you can use changed-data-capture with periodic … | |
Re: Actually, depending on what database you are using, the ANSI standard for inserting rows is: [CODE=mssql]INSERT into dbo.myTable (col_1, col_2, col_3) VALUES ('1', '2', '3') -- or numbers, or whatever the datatypes are for your columns[/CODE] Your second example would come out looking something like: [CODE=mssql]INSERT into dbo.myTable col_1 = … | |
Re: The few fake accounts that I have noticed all seem to have "Man" listed as their "Computer Specs and OS Flavor" and "Executive (C-level)" as their "Primary Role". Has anyone been analyzing data patterns in all the fake account entries? Or just looking for an uncommonly large number of posts? … | |
Re: What statement is causing the error? You should be doing some error trapping so that you can identify the specific line. Also, not sure where you call your sub "load_data" from. It isn't in the rest of the code snippet. Finally, what DBMS does your DSN "BIRREM2" point to? If … | |
Re: There are several different "flavors" of constraint. Some of them have to do with referential integrity, some have to do with uniqueness, some have to do with ranges of or lists of valid values, some have to do with defaults. Each has a use, but the bottom line is that … | |
Re: You are not explaining your problem clearly. I can see several problems with your stored procedure code, but until I know what you expect your result to be I can't really suggest anything. I ran your stored proc, and it seemed to properly add unique leave dates for each employee … | |
Re: Use the SelColor method. Example code: [CODE]Private Sub cmdCheckIn_Click() Me.RichTextBox1.SelColor = vbRed End Sub[/CODE] A further explanation (and example) is in the VB help file. Wonderful thing, that help file. You should browse it some time just for some interesting insights. | |
Re: Sounds like a homework assignment. Maybe...YOUR homework assignment? Perhaps you should post what code you have, and ask a question if you're stuck with something. If you're just assuming someone will write a program for you, you are in the wrong place. Sorry. | |
Re: Not sure what you mean by "trying to get a label to flip". If you have a label control embedded in your source picture box, it is ignored by PaintPicture. The PaintPicture method operates only with the Picture property of the supplied PictureBox control. So, if you haven't set that … | |
Re: Autonumber doesn't really work that way. There are a number of different ways you can "trick" it, depending on how you want to use the number. Simplest of all (of course) is don't worry about formatting your AutoNumber column when you store it. Just use a function to format it … | |
Re: The solution you propose should work. What code have you already tried? | |
Re: I think your last line should be more like: [CODE] MyRecordSet.Find "InvoiceLine.Refnum[COLOR="Red"]ber[/COLOR] = '" & CurrentReference & "'", , adSearchForward, 1[/CODE] |
The End.