Kamis, 28 Juli 2016

RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql

 

Prinsip UNION, menggabungkan beberapa tabel menjadi satu query. Dia akan berjalan, bila jumlah field yang dipilih sama antar semua tabel.

Select field1 from tabel1
union
select field21 from tabel2
union
select field31 from tabel3

Maka, bila field tabel1 akan diambil data lebih banyak, bisa diakali begini

Select field1,field2,field3,field4 from tabel1
union
select field21,field21,field21,field21 from tabel2
union
select field31,field31,field31,field31 from tabel3

Atau, bisa juga dibuat SQL per satuan.
Select * from tabel1
select field21 from tabel2
select field31 from tabel3

hasilnya lalu dioleh sesuai kebutuhan (misal disisir dengan nama tertentu).

Semoga bisa membantu dan memberi semangat.

Hariyanto (Surabaya)

--------------------------------------------
On Fri, 29/7/16, 'Cecep' cepwahyu@gmail.com [belajar-access] <belajar-access@yahoogroups.com> wrote:

Subject: RE: [belajar-access] Query Union Error ketika tabel terkoneksi ke MySql
To: belajar-access@yahoogroups.com
Date: Friday, 29 July, 2016, 10:40 AM


 









Mas Hariyanto terimakasih atas
responsnya,Combobox ini sy gunakan untuk
memfilter report dimana di comboboxnya akan muncul pilihan
– All – supaya report tampil semuanya dan pilihan
week_Subc supaya report yg tampil sesuai week yg diinginkan,
nah kata – All – ini bukan dari sebuah field tapi
langsung dibuat di Querynya.Setelah saya utak atik masalah
muncul jika ada tambahan UNION SELECT yg kedua (UNION
SELECT left([Week_Subc],5) From TblCultureIncoming), jadi kalo bagian ini saya
hilangkan tidak terjadi error, padahal sy juga memerlukan
data Week_Subc dari tabel ini.  Apakah ini memang tidak
memungkinkan atau bagaimana mas?  RegardCW  From:
belajar-access@yahoogroups.com
[mailto:belajar-access@yahoogroups.com]
Sent: 28 Juli 2016 20:13
To: belajar-access@yahoogroups.com
Subject: Re: [belajar-access] Query
Union Error ketika tabel terkoneksi ke
MySql    cepwahyu...,

Sepertinya ada masalah di
SQL-nya. Karena syarat penggunaan SQL, jumlah fieldnya harus
sama.

Coba ganti seperti
ini:

SELECT
left(nama_field,5) From TblCultureProduction
UNION
SELECT
left([Week_Subc],5) From TblCultureProduction
UNION SELECT left([Week_Subc],5) From
TblCultureIncoming;

Semoga
bisa membantu dan memberi semangat.

Hariyanto (Surabaya)

--------------------------------------------
On Thu, 28/7/16, 'Cecep' cepwahyu@gmail.com
[belajar-access] <belajar-access@yahoogroups.com>
wrote:

Subject:
[belajar-access] Query Union Error ketika tabel terkoneksi
ke MySql

To: belajar-access@yahoogroups.com
Date: Thursday, 28 July, 2016, 4:00 PM


 









Dear access mania,  Saat ini sy sedang
melakukan
migrasi BE access ke MySql dan
sudah berhasil tapi ada satu
masalah ketika
saya mencari data pada combobox padahal
ketika masih pake BE access tidak ada
masalah.Row Source pada combobox
sbb:SELECT
"--
All -- " From
TblCultureProduction  UNION SELECT
left([Week_Subc],5) From TblCultureProduction;
UNION SELECT
left([Week_Subc],5) From
TblCultureIncoming;  Jadi saya hanya akan
mengambil 5 karakter sebelah kiri saja.Nah
ketika BE sudah link ke
MySql tiba2 ketika
combobox tadi sy klik muncul error
sbb:
 Mohon pencerahanya kira2 apa
masalahnya
ya?
 Best RegardsCW









#yiv7574941962 #yiv7574941962 --
#yiv7574941962ygrp-mkp {
border:1px solid
#d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}

#yiv7574941962 #yiv7574941962ygrp-mkp hr {
border:1px solid #d8d8d8;}

#yiv7574941962 #yiv7574941962ygrp-mkp
#yiv7574941962hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}

#yiv7574941962 #yiv7574941962ygrp-mkp
#yiv7574941962ads {
margin-bottom:10px;}

#yiv7574941962
#yiv7574941962ygrp-mkp .yiv7574941962ad {
padding:0 0;}

#yiv7574941962 #yiv7574941962ygrp-mkp
.yiv7574941962ad p {
margin:0;}

#yiv7574941962
#yiv7574941962ygrp-mkp .yiv7574941962ad a {
color:#0000ff;text-decoration:none;}
#yiv7574941962 #yiv7574941962ygrp-sponsor
#yiv7574941962ygrp-lc {
font-family:Arial;}

#yiv7574941962 #yiv7574941962ygrp-sponsor
#yiv7574941962ygrp-lc #yiv7574941962hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}

#yiv7574941962
#yiv7574941962ygrp-sponsor
#yiv7574941962ygrp-lc .yiv7574941962ad {
margin-bottom:10px;padding:0 0;}

#yiv7574941962
#yiv7574941962actions {
font-family:Verdana;font-size:11px;padding:10px
0;}

#yiv7574941962
#yiv7574941962activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#yiv7574941962
#yiv7574941962activity span {
font-weight:700;}

#yiv7574941962 #yiv7574941962activity
span:first-child {
text-transform:uppercase;}

#yiv7574941962 #yiv7574941962activity span a
{
color:#5085b6;text-decoration:none;}

#yiv7574941962
#yiv7574941962activity span span {
color:#ff7900;}

#yiv7574941962 #yiv7574941962activity span
.yiv7574941962underline {
text-decoration:underline;}

#yiv7574941962 .yiv7574941962attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}

#yiv7574941962 .yiv7574941962attach div a {
text-decoration:none;}

#yiv7574941962 .yiv7574941962attach img {
border:none;padding-right:5px;}

#yiv7574941962
.yiv7574941962attach label {
display:block;margin-bottom:5px;}

#yiv7574941962
.yiv7574941962attach label a {
text-decoration:none;}

#yiv7574941962 blockquote {
margin:0 0 0 4px;}

#yiv7574941962 .yiv7574941962bold {
font-family:Arial;font-size:13px;font-weight:700;}

#yiv7574941962
.yiv7574941962bold a {
text-decoration:none;}

#yiv7574941962 dd.yiv7574941962last p a {
font-family:Verdana;font-weight:700;}

#yiv7574941962
dd.yiv7574941962last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#yiv7574941962
dd.yiv7574941962last p
span.yiv7574941962yshortcuts {
margin-right:0;}


#yiv7574941962 div.yiv7574941962attach-table
div div a {
text-decoration:none;}

#yiv7574941962
div.yiv7574941962attach-table {
width:400px;}

#yiv7574941962 div.yiv7574941962file-title a,
#yiv7574941962
div.yiv7574941962file-title
a:active, #yiv7574941962
div.yiv7574941962file-title a:hover,
#yiv7574941962
div.yiv7574941962file-title
a:visited {
text-decoration:none;}

#yiv7574941962
div.yiv7574941962photo-title a,
#yiv7574941962 div.yiv7574941962photo-title
a:active,
#yiv7574941962
div.yiv7574941962photo-title a:hover,
#yiv7574941962 div.yiv7574941962photo-title
a:visited {
text-decoration:none;}

#yiv7574941962
div#yiv7574941962ygrp-mlmsg
#yiv7574941962ygrp-msg p a
span.yiv7574941962yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#yiv7574941962
.yiv7574941962green {
color:#628c2a;}

#yiv7574941962
.yiv7574941962MsoNormal {

margin:0 0 0
0;}

#yiv7574941962 o {
font-size:0;}

#yiv7574941962 #yiv7574941962photos div {
float:left;width:72px;}

#yiv7574941962 #yiv7574941962photos div div
{
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}

#yiv7574941962
#yiv7574941962photos div label {

color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#yiv7574941962
#yiv7574941962reco-category {
font-size:77%;}

#yiv7574941962 #yiv7574941962reco-desc {
font-size:77%;}


#yiv7574941962 .yiv7574941962replbq {
margin:4px;}

#yiv7574941962 #yiv7574941962ygrp-actbar div
a:first-child {
margin-right:2px;padding-right:5px;}

#yiv7574941962
#yiv7574941962ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica,
clean,
sans-serif;}

#yiv7574941962 #yiv7574941962ygrp-mlmsg table
{
font-size:inherit;font:100%;}

#yiv7574941962
#yiv7574941962ygrp-mlmsg select,
#yiv7574941962 input, #yiv7574941962 textarea
{
font:99% Arial, Helvetica, clean,
sans-serif;}

#yiv7574941962
#yiv7574941962ygrp-mlmsg pre, #yiv7574941962
code {
font:115% monospace;}

#yiv7574941962
#yiv7574941962ygrp-mlmsg * {
line-height:1.22em;}

#yiv7574941962 #yiv7574941962ygrp-mlmsg
#yiv7574941962logo {
padding-bottom:10px;}


#yiv7574941962
#yiv7574941962ygrp-msg p a {
font-family:Verdana;}

#yiv7574941962 #yiv7574941962ygrp-msg
p#yiv7574941962attach-count span {
color:#1E66AE;font-weight:700;}

#yiv7574941962
#yiv7574941962ygrp-reco
#yiv7574941962reco-head {
color:#ff7900;font-weight:700;}

#yiv7574941962
#yiv7574941962ygrp-reco {
margin-bottom:20px;padding:0px;}

#yiv7574941962
#yiv7574941962ygrp-sponsor #yiv7574941962ov
li a {
font-size:130%;text-decoration:none;}

#yiv7574941962
#yiv7574941962ygrp-sponsor #yiv7574941962ov
li {
font-size:77%;list-style-type:square;padding:6px
0;}

#yiv7574941962
#yiv7574941962ygrp-sponsor #yiv7574941962ov
ul {

margin:0;padding:0 0 0
8px;}

#yiv7574941962
#yiv7574941962ygrp-text {
font-family:Georgia;}

#yiv7574941962 #yiv7574941962ygrp-text p {
margin:0 0 1em 0;}

#yiv7574941962 #yiv7574941962ygrp-text tt {
font-size:120%;}

#yiv7574941962 #yiv7574941962ygrp-vital ul
li:last-child {
border-right:none
!important;
}
#yiv7574941962










#yiv7586677502 #yiv7586677502 --
#yiv7586677502ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}

#yiv7586677502 #yiv7586677502ygrp-mkp hr {
border:1px solid #d8d8d8;}

#yiv7586677502 #yiv7586677502ygrp-mkp #yiv7586677502hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}

#yiv7586677502 #yiv7586677502ygrp-mkp #yiv7586677502ads {
margin-bottom:10px;}

#yiv7586677502 #yiv7586677502ygrp-mkp .yiv7586677502ad {
padding:0 0;}

#yiv7586677502 #yiv7586677502ygrp-mkp .yiv7586677502ad p {
margin:0;}

#yiv7586677502 #yiv7586677502ygrp-mkp .yiv7586677502ad a {
color:#0000ff;text-decoration:none;}
#yiv7586677502 #yiv7586677502ygrp-sponsor
#yiv7586677502ygrp-lc {
font-family:Arial;}

#yiv7586677502 #yiv7586677502ygrp-sponsor
#yiv7586677502ygrp-lc #yiv7586677502hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}

#yiv7586677502 #yiv7586677502ygrp-sponsor
#yiv7586677502ygrp-lc .yiv7586677502ad {
margin-bottom:10px;padding:0 0;}

#yiv7586677502 #yiv7586677502actions {
font-family:Verdana;font-size:11px;padding:10px 0;}

#yiv7586677502 #yiv7586677502activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}

#yiv7586677502 #yiv7586677502activity span {
font-weight:700;}

#yiv7586677502 #yiv7586677502activity span:first-child {
text-transform:uppercase;}

#yiv7586677502 #yiv7586677502activity span a {
color:#5085b6;text-decoration:none;}

#yiv7586677502 #yiv7586677502activity span span {

color:#ff7900;}

#yiv7586677502 #yiv7586677502activity span
.yiv7586677502underline {
text-decoration:underline;}

#yiv7586677502 .yiv7586677502attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}

#yiv7586677502 .yiv7586677502attach div a {
text-decoration:none;}

#yiv7586677502 .yiv7586677502attach img {
border:none;padding-right:5px;}

#yiv7586677502 .yiv7586677502attach label {
display:block;margin-bottom:5px;}

#yiv7586677502 .yiv7586677502attach label a {
text-decoration:none;}

#yiv7586677502 blockquote {
margin:0 0 0 4px;}

#yiv7586677502 .yiv7586677502bold {
font-family:Arial;font-size:13px;font-weight:700;}

#yiv7586677502 .yiv7586677502bold a {
text-decoration:none;}

#yiv7586677502 dd.yiv7586677502last p a {
font-family:Verdana;font-weight:700;}

#yiv7586677502 dd.yiv7586677502last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}

#yiv7586677502 dd.yiv7586677502last p
span.yiv7586677502yshortcuts {
margin-right:0;}

#yiv7586677502 div.yiv7586677502attach-table div div a {
text-decoration:none;}

#yiv7586677502 div.yiv7586677502attach-table {
width:400px;}

#yiv7586677502 div.yiv7586677502file-title a, #yiv7586677502
div.yiv7586677502file-title a:active, #yiv7586677502
div.yiv7586677502file-title a:hover, #yiv7586677502
div.yiv7586677502file-title a:visited {
text-decoration:none;}

#yiv7586677502 div.yiv7586677502photo-title a,
#yiv7586677502 div.yiv7586677502photo-title a:active,
#yiv7586677502 div.yiv7586677502photo-title a:hover,
#yiv7586677502 div.yiv7586677502photo-title a:visited {
text-decoration:none;}

#yiv7586677502 div#yiv7586677502ygrp-mlmsg
#yiv7586677502ygrp-msg p a span.yiv7586677502yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}

#yiv7586677502 .yiv7586677502green {
color:#628c2a;}

#yiv7586677502 .yiv7586677502MsoNormal {
margin:0 0 0 0;}

#yiv7586677502 o {
font-size:0;}

#yiv7586677502 #yiv7586677502photos div {
float:left;width:72px;}

#yiv7586677502 #yiv7586677502photos div div {
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}

#yiv7586677502 #yiv7586677502photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}

#yiv7586677502 #yiv7586677502reco-category {
font-size:77%;}

#yiv7586677502 #yiv7586677502reco-desc {
font-size:77%;}

#yiv7586677502 .yiv7586677502replbq {
margin:4px;}

#yiv7586677502 #yiv7586677502ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg table {
font-size:inherit;font:100%;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg select,
#yiv7586677502 input, #yiv7586677502 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg pre, #yiv7586677502
code {
font:115% monospace;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg * {
line-height:1.22em;}

#yiv7586677502 #yiv7586677502ygrp-mlmsg #yiv7586677502logo {
padding-bottom:10px;}


#yiv7586677502 #yiv7586677502ygrp-msg p a {
font-family:Verdana;}

#yiv7586677502 #yiv7586677502ygrp-msg
p#yiv7586677502attach-count span {
color:#1E66AE;font-weight:700;}

#yiv7586677502 #yiv7586677502ygrp-reco
#yiv7586677502reco-head {
color:#ff7900;font-weight:700;}

#yiv7586677502 #yiv7586677502ygrp-reco {
margin-bottom:20px;padding:0px;}

#yiv7586677502 #yiv7586677502ygrp-sponsor #yiv7586677502ov
li a {
font-size:130%;text-decoration:none;}

#yiv7586677502 #yiv7586677502ygrp-sponsor #yiv7586677502ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}

#yiv7586677502 #yiv7586677502ygrp-sponsor #yiv7586677502ov
ul {
margin:0;padding:0 0 0 8px;}

#yiv7586677502 #yiv7586677502ygrp-text {
font-family:Georgia;}

#yiv7586677502 #yiv7586677502ygrp-text p {
margin:0 0 1em 0;}

#yiv7586677502 #yiv7586677502ygrp-text tt {
font-size:120%;}

#yiv7586677502 #yiv7586677502ygrp-vital ul li:last-child {
border-right:none !important;
}
#yiv7586677502

__._,_.___

Posted by: hari yanto <har_i20002000@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

SPAM IS PROHIBITED

.

__,_._,___

Tidak ada komentar:

Poskan Komentar