655 Posted Topics

Member Avatar for coolbeanbob

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.

Member Avatar for BitBlt
0
157
Member Avatar for razamughal67

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 …

Member Avatar for BitBlt
0
444
Member Avatar for BitBlt

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)

Member Avatar for jbennet
2
84
Member Avatar for elexender

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 …

Member Avatar for elexender
0
192
Member Avatar for dwiniers

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.

Member Avatar for dwiniers
0
123
Member Avatar for moone009

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

Member Avatar for adam_k
0
232
Member Avatar for fawadkhalil

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 …

Member Avatar for adam_k
0
145
Member Avatar for nishasthomas.pt

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.

Member Avatar for BitBlt
0
38
Member Avatar for rechercheh

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.

Member Avatar for rechercheh
-1
132
Member Avatar for yeeitsneo

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 …

Member Avatar for abelingaw
0
168
Member Avatar for Sariscos

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

Member Avatar for Ancient Dragon
0
252
Member Avatar for cwarn23

I am working on an on-call coverage plan for the holidays. Whee. :yawn:

Member Avatar for pseudorandom21
0
396
Member Avatar for aboardandafish

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 …

Member Avatar for ChrisPadgham
0
146
Member Avatar for Sam367

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.

Member Avatar for Sam367
0
96
Member Avatar for jcarbillon

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.

Member Avatar for BitBlt
0
160
Member Avatar for skyshare

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.

Member Avatar for skyshare
0
148
Member Avatar for RASHIDDDDD

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 …

Member Avatar for BitBlt
0
92
Member Avatar for swaleh_sundus

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 …

Member Avatar for ChrisPadgham
0
433
Member Avatar for MARKAND911

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

Member Avatar for BitBlt
0
146
Member Avatar for edpfister

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 …

Member Avatar for BitBlt
0
1K
Member Avatar for SANJU081

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.

Member Avatar for BitBlt
0
141
Member Avatar for gennesis

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 …

Member Avatar for gennesis
0
367
Member Avatar for jovillanuev

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 …

Member Avatar for jovillanuev
0
158
Member Avatar for srm2010

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]

Member Avatar for BitBlt
0
56
Member Avatar for visweswaran28

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 …

Member Avatar for BitBlt
0
187
Member Avatar for M.Waqas Aslam

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 …

Member Avatar for M.Waqas Aslam
0
139
Member Avatar for CSharpUser

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 …

Member Avatar for BitBlt
0
467
Member Avatar for dbwalters67

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 …

Member Avatar for dbwalters67
0
319
Member Avatar for Hajira Khanum

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!

Member Avatar for stultuske
-1
184
Member Avatar for cyberdaemon

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 …

Member Avatar for cyberdaemon
0
127
Member Avatar for jacksantho

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 …

Member Avatar for ChrisPadgham
0
430
Member Avatar for kyklops

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

Member Avatar for ChrisPadgham
0
214
Member Avatar for OmegaCoCo

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 …

Member Avatar for BitBlt
0
103
Member Avatar for RickCJ7

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 …

Member Avatar for BitBlt
0
1K
Member Avatar for amf101

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 …

Member Avatar for BitBlt
0
208
Member Avatar for jovillanuev

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 …

Member Avatar for BitBlt
0
103
Member Avatar for visweswaran28

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

Member Avatar for BitBlt
0
138
Member Avatar for SNES

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 …

Member Avatar for SNES
0
115
Member Avatar for jacksantho

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 …

Member Avatar for BitBlt
0
216
Member Avatar for violette

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

Member Avatar for dspnhn
0
895
Member Avatar for happygeek

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

Member Avatar for Dani
2
1K
Member Avatar for aileengrace03

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 …

Member Avatar for BitBlt
0
214
Member Avatar for mick214

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 …

Member Avatar for BitBlt
0
64
Member Avatar for bbman

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 …

Member Avatar for BitBlt
0
207
Member Avatar for Suirbachi

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.

Member Avatar for BitBlt
0
278
Member Avatar for rocdigga1486

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.

Member Avatar for BitBlt
0
97
Member Avatar for legodadda

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 …

Member Avatar for BitBlt
0
352
Member Avatar for gminezes

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 …

Member Avatar for BitBlt
0
159
Member Avatar for kiki256
Member Avatar for bcogan6502

I think your last line should be more like: [CODE] MyRecordSet.Find "InvoiceLine.Refnum[COLOR="Red"]ber[/COLOR] = '" & CurrentReference & "'", , adSearchForward, 1[/CODE]

Member Avatar for BitBlt
0
690

The End.