Search:

Type: Posts; User: PilgrimPete

Page 1 of 13 1 2 3 4

Search: Search took 0.71 seconds.

  1. Replies
    1
    Views
    472

    Re: SQL Server ignore delete .txt rows

    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...
  2. Replies
    5
    Views
    424

    Re: sql query help

    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...
  3. Replies
    11
    Views
    1,240

    Re: Access VB questions

    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.
    ...
  4. Thread: question

    by PilgrimPete
    Replies
    3
    Views
    338

    Re: question

    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
    (
  5. Thread: question

    by PilgrimPete
    Replies
    3
    Views
    338

    Re: question

    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...
  6. Re: copy sql data to anothers fields

    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...
  7. Re: Another Question about changing the table using combo but with WHERE

    Good spot. :)
    Sorry about that!
  8. Re: Another Question about changing the table using combo but with WHERE

    Close, but you need to parameterise the SQL in the same way:


    conn.Execute "DELETE from " & cmbTable.Text & "where lectureNumber = '" & txtLectureNumber.Text & "'"
  9. Re: count last 7 row data from sql database table

    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='" &...
  10. Replies
    3
    Views
    525

    Re: combine data sql query help

    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,...
  11. Re: count last 7 row data from sql database table

    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
  12. Replies
    3
    Views
    525

    Re: combine data sql query help

    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...
  13. Re: Automatically creating new fields in Access using Macros

    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;
  14. Re: Using Access Database; if other users try my program, do they need MSAccess installed

    My initial answer would have been "yes", but you might want to look into the Access Runtime. Hope it helps.
  15. Replies
    3
    Views
    1,323

    Re: Vb6 Insert Event Access

    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...
  16. Replies
    7
    Views
    441

    Re: Adding fields

    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...
  17. Replies
    7
    Views
    441

    Re: Adding fields

    It looks like you have two datatables in your dataset.
    Table1 doesn't have a "Cost" column in it, Table2 does.
  18. Replies
    1
    Views
    547

    Re: ADO data control newbie Q

    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...
  19. Thread: SQL search

    by PilgrimPete
    Replies
    33
    Views
    1,849

    Re: SQL search

    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.
  20. Thread: SQL search

    by PilgrimPete
    Replies
    33
    Views
    1,849

    Re: SQL search

    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...
  21. Thread: SQL search

    by PilgrimPete
    Replies
    33
    Views
    1,849

    Re: SQL search

    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...
  22. Replies
    9
    Views
    811

    Re: Taking dead space out of spreadsheets

    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...
  23. Replies
    36
    Views
    1,150

    Re: Help with DAO UPDATE statement

    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 " & _
    ...
  24. Replies
    36
    Views
    1,150

    Re: Help with DAO UPDATE statement

    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=" &...
  25. Replies
    6
    Views
    433

    Re: Checking a connection

    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...
  26. Replies
    2
    Views
    8,204

    Re: How to Insert Date type in Visual FoxPro

    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... :)
  27. Replies
    6
    Views
    433

    Re: Checking a connection

    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.
  28. Replies
    15
    Views
    796

    Re: Retrieving .frm from table

    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()...
  29. Replies
    4
    Views
    502

    Re: Noobish question

    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...
  30. Replies
    15
    Views
    796

    Re: Retrieving .frm from table

    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...
  31. Replies
    4
    Views
    654

    Re: Help With Vb6+sql

    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...
  32. Replies
    4
    Views
    654

    Re: Help With Vb6+sql

    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...
  33. Replies
    5
    Views
    540

    Re: Multiple SQL Tables To Excel

    No probs.

    There's actually quite a good article on Wikipedia.

    The basics are as follows:

    TABLE - Person
    PersonID
    FirstName
    LastName
  34. Replies
    5
    Views
    540

    Re: Multiple SQL Tables To Excel

    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...
  35. Replies
    6
    Views
    648

    Re: query - max with distinct

    Ah, I see.
    Like this?


    SELECT ProductID, Amount, Date
    FROM [b0prStk_Save]
    WHERE Serial IN
    (
    SELECT MAX(Serial)
    FROM [b0prStk_Save]
  36. Re: [RESOLVED] query - select more collum with max

    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)
  37. Replies
    6
    Views
    648

    Re: query - max with distinct

    Does this do it:


    SELECT ProductID, Amount, Serial
    FROM [b0prStk_Save]
    WHERE date = myDDD

    ...or am I missing something?
  38. Re: [RESOLVED] query - select more collum with max

    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...
  39. Re: [RESOLVED] query - select more collum with max

    I think it was resolved in Post 3, but r_amin has a few more questions...
  40. Re: [RESOLVED] query - select more collum with max

    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...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width