Search:
Type: Posts; User: PilgrimPete
Search:
Search took 0.71 seconds.
-
You can use FIRSTROW = 3 to quite easily ignore the first couple of lines.
Ignoring the last one is trickier.
BULK INSERT also has a LASTROW parameter, but you'll need to know how many lines there...
-
You could do this by recursively calling a user defined function in SQL Server. It's hard to do with just SQL - unless you have a finite tree depth, and even then I'm not sure it will be easy.
Which...
-
You've got a couple of problems that I can see straight away, but they might be typos when you posted...
1. You could do with a space before the SELECT;
2. partcicipantID has a spare 'c' in it.
...
-
Pretty much the same:
SELECT c.customer_id,
c.customer_name,
o.EndDate,
DATEDIFF("dd", o.EndDate, Date()) AS DaysSinceEnd
FROM CUSTOMER TABLE AS c
INNER JOIN
(
-
What database are you using?
You could do it using SQL Server like this:
SELECT c.customer_id,
c.customer_name,
o.EndDate,
DATEDIFF(day, o.EndDate, GETDATE()) DaysSinceEnd
FROM CUSTOMER...
-
I'd agree with kevchadders, but armed with the information you provided in this post, I think we can do it with a JOIN.
Something like this:
UPDATE spcdata
SET SevenPoint = s2.Data
FROM...
-
Good spot. :)
Sorry about that!
-
Close, but you need to parameterise the SQL in the same way:
conn.Execute "DELETE from " & cmbTable.Text & "where lectureNumber = '" & txtLectureNumber.Text & "'"
-
You don't need the outer quotes in your code.
"Set m_rs = OpenRecordset("SELECT SUM(compare) AS Ttl From ('SELECT TOP 35 compare From spcdata where partno ='" & partno & "' and machineno='" &...
-
Hmm. That's a bit trickier.
Here is a solution; I'm not sure it is the most efficicient though:
SELECT t1.PartNo, t1.Dimension, t1.MachineNo, t1.[Date], t1.[Time],
SUM(d1) D1, SUM(d2) D2,...
-
Something like this:
SELECT SUM(compare) AS Ttl
FROM
(
SELECT TOP 7 compare
FROM theTable
ORDER BY date DESC,time DESC
) src
should do the trick
-
What do you want out of the query?
This should return one row, but I'm not sure you'll get all the data you need:
SELECT Id,partno,dimension,machineno,date,time
FROM theTable
GROUP BY...
-
Hi. Welcome to the forum. :wave:
You can create a Data Definition query:
ALTER TABLE theTable
ADD PageExtent TEXT(20),
RunCode TEXT(20),
MailSortTrigger SMALLINT;
-
My initial answer would have been "yes", but you might want to look into the Access Runtime. Hope it helps.
-
Hi Vntalk.
Could you explain what you want to achieve - and possibly why - it would help us to help you.
VB forms don't have an AfterInsert event like Access does for example. Are you using a...
-
Actually. That's only half right.
You are filling the datatable, not a dataset aren't you?
My guess is that only the first SQL statement (ssql) is being run to fill your table. Do you need both...
-
It looks like you have two datatables in your dataset.
Table1 doesn't have a "Cost" column in it, Table2 does.
-
Hi, have you actually tried to bind any controls on the form to the ADODC?
I just opened a project and added a data control and ran your code. I got the same error.
Then I added a textbox and...
-
The SQL looks good to me.
Are you using DAO? If so, I think you should take Hack's advice (post #6) and use the OpenRecordset method. That might just make all the difference.
-
As TysonLPrice suggests, have you tried putting a
Debug.Print strSQL in your code and running the SQL directly in Access?
(There is a spare space or two in your code above between...
-
I agree with the others, that although the field name is allowable in Access, I'd recommend changing it as you'll be storing up problems in future.
Does this work?
strSQL = "SELECT...
-
The After:=Range("A1") bit is the problem part. You need to fully qualify it, you could try something like this:
Dim wsht As Worksheet
Set wsht = wkbObj.Worksheets(ix)
Set...
-
You still have the same issue with the dbFailOnError constant.
Do either of these work?
Private Sub cmdOK_Click()
db.Execute "UPDATE tControl SET cRs!ctrlDate = TargetDate " & _
...
-
Your problem looks like this:
Dim BatId As Long
Dim cRs As DAO.RecordSet
db.Execute "UPDATE tControl SET cRs!ctrlDate = TargetDate " & _
"WHERE batchId=" & BatId & " And coNum=" &...
-
OK, great. Thanks.
And you open the connection just before executing the query? If so, you should be able to enclose it in a try..catch construct and deal with any connectivity exceptions in the...
-
I'm guessing here, sorry, but have you tried converting the date string to '20080504'?
The last response to this post might be more helpful though... :)
-
What language are you coding in?
If you open the connection just before executing the query, you should be able to trap any exception conditions relating to connectivity.
-
It depends on what you would like to display, but this simple example worked for me:
Private Sub Form_Load()
oleContainer.CreateEmbed "c:\mydoc.doc"
End Sub
I'd research CreateEmbed()...
-
You can't add extra parameters to the event handler; but, does something like this work for you?
Private Sub Text2_Change()
call AnotherSub(Text2.Text)
End Sub
Private Sub...
-
Do you need to embed the puzzles in the forms? Is there no way that you can make the puzzles load dynamically - into an OLE object for example?
That way you can reduce the number of forms you need...
-
Sorry, reading that back, it isn't very clear. Perhaps I should take my own advice, and be more specific!!
I meant that it would be easier to get to the root of the problem if monzter_tm was more...
-
Hi monzter_tm, welcome to the forum. :)
I can see two potential issues:
1. put square brackets around BackUp - it is a reserved word;
2. give the UNION result an alias, eg.
SELECT * FROM...
-
No probs.
There's actually quite a good article on Wikipedia.
The basics are as follows:
TABLE - Person
PersonID
FirstName
LastName
-
Welcome to the forum. :)
I recommend you check out the FAQs at the top of this forum.
What you need is to learn to JOIN tables together.
There is a link to a tutorial in the FAQ here:
SQL...
-
Ah, I see.
Like this?
SELECT ProductID, Amount, Date
FROM [b0prStk_Save]
WHERE Serial IN
(
SELECT MAX(Serial)
FROM [b0prStk_Save]
-
OK, I'd have thought that this would do it then:
SELECT serial, date, serviceID, Amount
FROM [b0prStk_Save]
WHERE Serial IN (SELECT MAX(Serial) FROM [b0prStk_Save] GROUP BY serviceID)
-
Does this do it:
SELECT ProductID, Amount, Serial
FROM [b0prStk_Save]
WHERE date = myDDD
...or am I missing something?
-
OK. That's great, thanks. But how do you identify the client?
I see the ID is a concatenation of serial (which is itself a formatted version of date) and serviceID, I don't see any reference to...
-
I think it was resolved in Post 3, but r_amin has a few more questions...
-
OK. I think that could be because I don't fully understand your schema.
Could you post the list of columns in your table, and what they represent. That will give me a better chance of helping you...
|
Click Here to Expand Forum to Full Width
|