Rabu, 26 Desember 2012

[MS_AccessPros] Re: Sort Ascending Not Run Properly in Append Query

 

Hi Hendra,

Normally an ID Field would be unique. Your Z table
has the value 5 repeated in the first two records.

You should always have a unique field or unique
combination of fields for a primary Key.

Hope that helps,

Regards, Clive.

--- In MS_Access_Professionals@yahoogroups.com, "agesthahendra@..." <agesthahendra@...> wrote:
>
> Hi Everyone,...
>
> I try to describe what i mean :
>
> I have two tables, named Z (as source) and ZZ (as destination), they each has 2 fields, [ID] (Long Int. - indexed) and [Data] (Int. - no indexed),
> i want to append all the records in Z to ZZ, for example i've made 3 records in Z table (as source) :
>
> ID Data
> -- ----
> 5 1
> 5 5
> 6 3
>
> then i made an append query from Z to ZZ, :
>
> INSERT INTO ZZ ( ID, Data )
> SELECT Z.ID, Z.Data
> FROM Z
> ORDER BY Z.Data;
>
> after i ran the query the result is wrong, Still the same as the Z's Records like above... because of the syntax : ORDER BY Z.Data, i think the result should be like this :
>
> ID Data
> -- ----
> 5 1
> 6 3
> 5 5
>
> but if i change the Append Query to Make Table Query :
>
> SELECT Z.ID, Z.Data INTO ZZ
> FROM Z
> ORDER BY Z.Data;
>
> the results are right (Sort ascending run properly in make table query or select query)...
>
> I need to use Append Query, What do i miss here..?
>
> Regards
> Hendra
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar