Showing posts with label FILM INDO KUALITAS LUAR. Show all posts
Showing posts with label FILM INDO KUALITAS LUAR. Show all posts

Monday, June 24, 2013

Mencari Selisih Antara 2 Tanggal/DateTime pada SQL

Mencari Selisih Antara 2 Tanggal/DateTime pada SQL
13 Feb
SQL Server menyediakan Fungsi Tanggal untuk memanipulasi data jenis Datetime dengan menggunakan Operator Aritmatika.Sehingga kita lebih mudah dalam menghitung dan mencari selisih dari dua tanggal / DateTime. Misalnya kita ingin mencari berapa selisih antara tanggal ‘02-02-2012‘ dan ‘20-02-2012‘ maka hasilnya adalah ‘18 Hari .’
Nah, di SQL kita dipermudah dengan adanya fungsi tanggal tersebut.Adapun query yang digunakan untuk mencari selisih dari 2 datetime tersebut ialah DateDiff. DateDiff berfungsi untuk mencari selisih dua buah datetime.DateDiff bukan hanya digunakan untuk mencari selisih Hari tetapi juga bisa mencari selisih Bulan,dan Tahun.
Sintaks : DateDiff ( DatePart, Date1, Date2)
DatePart yaitu Interval DateTime yang kita ingin cari, misalnya Date, Month, Year
Pembahasan :
create table Transaksi (
Nama varchar (15), CheckIn datetime, CheckOut datetime
)
insert into Transaksi values (‘Budi’,’11/10/11′,’11/12/11′)
insert into Transaksi values (‘Rina’,’10/12/11′,’10/20/11′)
insert into Transaksi values (‘Danu’,’12/25/11′,’01/03/12′)
insert into Transaksi values (‘Satrya’,’01/10/11′,’01/15/11′)
insert into Transaksi values (‘Erni’,’02/05/11′,’02/08/11′)
Select * From Transaksi
Maka hasilnya akan seperti dibawah ini :
Lalu, untuk mencari berapa Hari Customer menginap kita gunakan fungsi DateDiff yang baru saja kita bahas tadi.
Select Customer, CheckIn, CheckOut, DateDiff (Day,CheckIn,CheckOut) as ‘Total Hari’
from Transaksi
Maka akan tampil seperti berikut :


Menghitung banyak hari
procedure TForm1.Button1Click(Sender: TObject);
var
  date1, date2: TDateTime;
  difference: Integer;
begin
  date1 := EncodeDate(2006, 01, 15);
  date2 := EncodeDate(2000, 01, 01);
  difference := trunc(date1) - trunc(date2);
  ShowMessage(IntToStr(difference));
end;


Tanggal terakhir
function LastDayOfCurrentMonth: TDate;
var
  y, m, d: Word;
begin
  DecodeDate(now, y, m, d);
  m := m + 1;
  if m  12 then
  begin
    y := y + 1;
    m := 1;
  end;
  Result := EncodeDate(y, m, 1) - 1;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(DateToStr(LastDayOfCurrentMonth));
end;

function GetDays(ADate: TDate): Extended;
var
  FirstOfYear: TDateTime;
begin
  FirstOfYear := EncodeDate(StrToInt(FormatDateTime('yyyy', now)) - 1, 12, 31);
  Result      := ADate - FirstOfYear;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  label1.Caption := 'Today is the ' + FloatToStr(GetDays(Date)) + '. day of the year';
end;



function CalculateAge(Birthday, CurrentDate: TDate): Integer;
var
  Month, Day, Year, CurrentYear, CurrentMonth, CurrentDay: Word;
begin
  DecodeDate(Birthday, Year, Month, Day);
  DecodeDate(CurrentDate, CurrentYear, CurrentMonth, CurrentDay);
  if (Year = CurrentYear) and (Month = CurrentMonth) and (Day = CurrentDay) then
  begin
    Result := 0;
  end
  else
  begin
    Result := CurrentYear - Year;
    if (Month > CurrentMonth) then
      Dec(Result)
    else
    begin
      if Month = CurrentMonth then
        if (Day > CurrentDay) then
          Dec(Result);
    end;
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption := Format('Your age is %d', [CalculateAge(StrToDate('01.03.1953'), Date)]);
end;

Monday, June 25, 2012

God Bless America

God Bless America



Released : May 31, 2012
Genre : Comedy , Crime 
Starcast : Joel Murray, Tara Lynne Barr, Mackenzie Brooke Smith 
Desc :
On a mission to rid society of its most repellent citizens, terminally ill Frank makes an unlikely accomplice in 16-year-old Roxy. 
Duration : 1:45 
Size : 125mb 


Download


Sunday, June 10, 2012

The Raid: Redemption

The Raid : Redemption



Released : May 11, 2012
Genre : Action , Crime , Thriller 
Starcast : Iko Uwais, Joe Taslim, Donny Alamsyah, Yayan Ruhian 
Desc :
A SWAT team becomes trapped in a tenement run by a ruthless mobster and his army of killers and thugs. 
Duration : 1:41 
Size : 120mb 

PART 1 



SERVER 1
SERVER 2
SERVER 3

Part 2





SERVER 1
SERVER 2
SERVER 3