Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: quotation symbol

    CurrentDb.Execute "INSERT INTO [Rep] ([Name], [Num] ) " & _
    "select distinct [Name],DCount('*', 'Input','[Name] = '' & [Name] & '') from [Input]"

    I have a question of the DCount, which quotation symbol is for string, because the DCount function cannot run in above sentence, it always 0. It should have values,

    ...........DCount('*','Input','[Name] = '' & [Name] & '')...........

    What's wrong?
    Thanks.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    "Name = '" & name & "'")
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    One little thing - you know that is an extremely inefficient way of doing what you want yes?

    Code:
    CurrentDb.Execute "INSERT INTO [Rep] ([Name], [Num]) " & _
    "select [Name],Count(*) from [Input] GROUP BY Name"
    Much better!

    A second little thing - how come you are storing this rather than calculating as and when requried?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    And of course there's the whole "storing derived data" thing, but this particular forum member has been lectured before, at great length, regarding this practice...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Teddy
    And of course there's the whole "storing derived data" thing, but this particular forum member has been lectured before, at great length, regarding this practice...
    FGA contender (Frequently Given Answers)?
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •