Delphi Indonesia - Mobile Edition

nama: pass:

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ekopranotoOffline
Location:
Post subject: Query penjumlahan data and sort Date  PostPosted: 02/Sep/2010 15:14
onBeginner


Joined: 30-Aug-2010
Posts: 4

Status: Offline
Para Master Delphi mohon bantuannya
aq punya syntaq query semacam ini :

sql.Add('select count(distinct datelog)as absensi from personallog where datelog between :tgl1 and :tgl2 and fingerprintid like '+QuotedStr(''+stnik.Caption+''));

tapi setelah aq run muncul aplikasi message seperti ini :
syntax error missing operator in query expression

mohon petunjuknya untuk pencarian jumlah data , berdasarkan tanggal , dan tanggal itu tidak ada yang boleh sama (database aq manipulasi dari sistem absensi finger print)

trims ...... Smile
 
 View user's profile Send private message  
Reply with quote Back to top
budi_slemanOffline
Location:
Post subject: Re: Query penjumlahan data and sort Date  PostPosted: 05/Sep/2010 08:49
onConfident


Joined: 24-Dec-2009
Posts: 22

Status: Offline
      ekopranoto wrote:
Para Master Delphi mohon bantuannya
aq punya syntaq query semacam ini :

sql.Add('select count(distinct datelog)as absensi from personallog where datelog between :tgl1 and :tgl2 and fingerprintid like '+QuotedStr(''+stnik.Caption+''));

tapi setelah aq run muncul aplikasi message seperti ini :
syntax error missing operator in query expression

mohon petunjuknya untuk pencarian jumlah data , berdasarkan tanggal , dan tanggal itu tidak ada yang boleh sama (database aq manipulasi dari sistem absensi finger print)

trims ...... Smile


mungkin ini
sql.Add('select count(distinct datelog)as absensi from personallog where datelog between :tgl1 and :tgl2 and fingerprintid like '+QuotedStr(''+stnik.Caption+'')+');
kurang tanda '+QuotedStr(''+stnik.Caption+'')+'

maaf kalau salah, soalnya nggak nyoba langsung sih
 
 View user's profile Send private message  
Reply with quote Back to top
hawkeyeOffline
Location:
Post subject:   PostPosted: 05/Sep/2010 13:15
onConfident


Joined: 30-Aug-2007
Posts: 25

Status: Offline
sql.Add('select count(distinct datelog)as absensi from personallog where datelog between :tgl1 and :tgl2 and fingerprintid like '+QuotedStr(''+stnik.Caption+''));

coba yang QuotedStr dijadikan --> QuotedStr("%"+stnik.Caption+"%"). Soalnya gak tahu itu single apostrof (') 2 kali atau double apostrof (") satu kali. setahu saya kalau di dalam sql di delphi untuk menjadikan string dengan menggunakan double apostrof (") bukan single apostrof(').

Misal : sql.Add('SELECT * FROM table_data WHERE nama_orang="BEJO" AND hapus=0');

sebelum dan sesudah bejo menggunakan double apostrof(") kalau di keyboard letak nya di atas petik satu/single apostrof dan dengan menekan tombol SHIFT
 
 View user's profile Send private message  
Reply with quote Back to top
cyber_heckerOffline
Location: Ponti Hot City
Post subject:   PostPosted: 05/Sep/2010 14:10
onProfessional


Joined: 19-May-2005
Posts: 981
Location: Ponti Hot City
Status: Offline
kayaknya error gara-gara ada distinc nya deh.. klo ga ada distinct gimana ?

_________________
 
 View user's profile Send private message Yahoo Messenger MSN Messenger  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits
RSS