-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
putra_wlhOffline
Location:
Post subject: filter field datetime tanggal dan bulan  PostPosted: 10/Mar/2009 12:35
onBeginner


Joined: 10-Mar-2009
Posts: 5

Status: Offline
Ada yg bisa bantu..
saya ingin memfilter field datetime menurut taggal dan bulan saja pada SQLServer menggunakan Delphi 7 dengan BDE. saya sudah mencoba beberapa cara menggunakan Query maupun Table di antaranya:
1. Dengan menggunakan table pada event OnFilterRecord
tgl := FormatDateTime('DD/MMM', Date);
s := DataSet['tgl'];
Accept := s = QuotedStr(tgl);
2. pada button saya beri variabel dengan nilai yg di sesuaikan pada event onFilterRecord
3. dataset di beri value.
4. pada table di tentukan fieldnya
5. Dengan menggunakan Query menggnakan parameter pada tangal
if Query1.paramByName('tgl').AsString = FormatDateTime('DD/MMM', Date) then
Query1.Open
6. pernah juga di beri copy (dah lieur pisan jigana mah.. hueuuehehehe..)
6. dan masih banyak lagi klo di tulis smuanya ga kan slesai...
field tgl sudah di set menjadi string atau value dengan menggunakn table maupun query tetap mengalami error..

Mohon Bantuannya.....
 
 View user's profile Send private message  
Reply with quote Back to top
ichan29Offline
Location:
Post subject: RE: filter field datetime tanggal dan bulan  PostPosted: 10/Mar/2009 13:34
onProfessional


Joined: 23-Feb-2007
Posts: 603

Status: Offline
sederhana sebenernya, cuman dikau ngga baca di help SQLServer nya..
manfaatkan fungsi month dan year
      Code:
decodedate(tanggal,tahun,bulan,hari)
select * from table where year(tanggal)='+QutoedStr(inttostr(tahun))+
' and month(tanggal)='+QuotedStr(inttostr(bulan));

kurang lebih seperti itu, kembangkan sendiri sesuai dg yg dimaksud
 
 View user's profile Send private message  
Reply with quote Back to top
ichan29Offline
Location:
Post subject: RE: filter field datetime tanggal dan bulan  PostPosted: 10/Mar/2009 14:05
onProfessional


Joined: 23-Feb-2007
Posts: 603

Status: Offline
eh sorry, yg ditanya adalah bulan dan hari ya..
      Code:
select * from table where month(tanggal)='+QutoedStr(inttostr(bulan))+
' and day(tanggal)='+QuotedStr(inttostr(hari));

tp klo buat periode tinggal hari mulai dari sampai dg... tau kan.
 
 View user's profile Send private message  
Reply with quote Back to top
ir1kerenOffline
Location:
Post subject: RE: filter field datetime tanggal dan bulan  PostPosted: 12/Mar/2009 16:59
onConfident


Joined: 22-Nov-2007
Posts: 29

Status: Offline
sklian klo mo filter dengan range bulan dan taon tertentu, misal dari bulan 01/04 ampe 07/05

      Code:

'select * from table where (month(tanggal) between '+QuotedStr(IntTostr(bulan_1))+' AND '+
QuotedStr(IntToStr(bulan_2))+') AND (day(tanggal) between '+QuotedStr(IntToStr(tanggal_1))+
' AND '+QuotedStr(IntToStr(tanggal_2))+')'
 
 View user's profile Send private message  
Reply with quote Back to top
putra_wlhOffline
Location:
Post subject: RE: filter field datetime tanggal dan bulan  PostPosted: 01/Apr/2009 10:55
onBeginner


Joined: 10-Mar-2009
Posts: 5

Status: Offline
Master2..
terima kasih jawabannya...
sudah d coba pada query di delphi untuk SQLServer menggunakan BDE..
Memang klo d SQL Explorer Delphi ataupun SQLServernya bisa...
hanya saja setelah d coba pada Query d Delphi hasilnya Optimizer Lock Hints.

Setelah itu saa coba ubah dengan berbagai macam cara tapi tetep aja hasilnya sama, atau error pada code yang saya ubah...

bagaimana seharusnya untuk menangani Optimizer Lock Hints...
 
 View user's profile Send private message  
Reply with quote Back to top
putra_wlhOffline
Location:
Post subject: RE: filter field datetime tanggal dan bulan  PostPosted: 01/Apr/2009 12:30
onBeginner


Joined: 10-Mar-2009
Posts: 5

Status: Offline
Yaa...
sudah berhasil...
setelah coba di ulang dari awal lagi semuanya baru bisa...
hehehe... ;p
Embarassed
 
 View user's profile Send private message  
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


| Register | Lost Password ? |