
806 A.2d 988 (2002)
Anthony F. TAGLIENTI, Petitioner,
v.
DEPARTMENT OF CORRECTIONS OF the COMMONWEALTH OF PENNA., Respondent.
Commonwealth Court of Pennsylvania.
Submitted on Briefs July 12, 2002.
Decided September 13, 2002.
As Amended October 31, 2002.
*989 Anthony F. Taglienti, petitioner, pro se.
Alan M. Robinson, Camp Hill, for respondent.
Before: PELLEGRINI, Judge, LEAVITT, Judge, and KELLEY, Senior Judge.
OPINION BY Senior Judge KELLEY.
Presently before this Court for disposition in our original jurisdiction is a Motion for Summary Judgment filed by Anthony F. Taglienti, pro se, and a cross Application for Summary Relief filed by the Pennsylvania Department of Corrections (DOC).
On December 5, 2001, Taglienti filed a Petition for Review Seeking Mandamus Relief, which by order of December 10, 2001, this Court treated as a petition for review addressed to our original jurisdiction.[1] Therein, Taglienti alleges that the DOC miscalculated his maximum prison sentence release date. Taglienti alleges that he was incarcerated in the State of Virginia when he entered the Pennsylvania prison system on October 27, 1999 via a Pennsylvania detainer for violation of parole issued from the Court of Common Pleas of Philadelphia County. Taglienti alleges that he was sentenced on October 27, 2000 by the Philadelphia Court of Common Pleas to three concurrent sentences of 12-24 months; 6-24 months and 9-24 months on bill and term numbers XXXX-XXXX-XX; XXXX-XXXX through 1538; and XXXX-XXXX with credit for time served from the date of incarceration on the detainer imprisoning him in the Pennsylvania prison system.[2] Taglienti alleges that he was sent back to Virginia on November 19, 2000 after spending one year and twenty-two months in the Pennsylvania prison system. Taglienti alleges that he was returned by detainer to Pennsylvania on January 27, 2001 to serve the remainder on his three concurrent sentences putting his maximum release date at January 5, 2002 in compliance with the sentencing court.
Taglienti alleges that the DOC refuses to honor the sentencing court's orders for credit for time served from October 27, 1999 to November 19, 2000. Taglienti alleges that he is entitled to credit for time served while he was incarcerated in Philadelphia for the period October 27, 1999 to November 19, 2000. Taglienti is requesting that this Court order the DOC to credit his sentences, correct its records to reflect the credit, and to observe that his release date and maximum sentence expired on January 5, 2002.
On January 4, 2002, the DOC filed an answer to Taglienti's Petition for Review. Therein, the DOC admits that the Court of Common Pleas of Philadelphia County sentenced Taglienti on October 27, 2000 to three concurrent sentences ranging from 6 *990 months to 24 months. The DOC also admits that Taglienti was returned to the custody of the State of Virginia on November 19, 2000. However, in new matter, the DOC alleges that from December 29, 1998 through January 23, 2001, Taglienti was in the custody of the State of Virginia and actively serving a sentence for offenses unrelated to those in Philadelphia. The DOC alleges further that while during the time period of October 27, 1999 to November 19, 2000, Taglienti was incarcerated in Philadelphia, he was actively serving and received credit on his sentence in the State of Virginia. Therefore, the DOC alleges that it correctly calculated Taglienti's minimum and maximum sentence expiration dates and that Taglienti's Petition for Review should be dismissed.
On January 22, 2002, Taglienti filed an "Answer to New Matter and Now New Matter." Therein, Taglienti admits that during the time period of October 27, 1999 through November 19, 2000, he was actively serving and received credit on his sentence in the State of Virginia. By way of further answer, Taglienti alleges that Section 9761(b) of the Judicial Code, 42 Pa. C.S. § 9761(b), authorizes sentencing courts to sentence concurrent Pennsylvania sentences with other sovereigns. Taglienti alleges that the Commonwealth of Pennsylvania gave him credit and the State of Virginia and the DOC cannot now try and take that credit away from him.
On or about February 11, 2002, the DOC served Taglienti with its First Request for Admissions under Pa.R.C.P. No. 4014. In response to that request, Taglienti again admits that he received credit on his Virginia sentence for the time period October 27, 1999 through November 19, 2000. However, Taglienti again asserts that he is entitled to time for credit served on the sentences imposed by the Court of Common Pleas of Philadelphia County while in custody in Pennsylvania.
On April 18, 2002, Taglienti filed a Motion for Summary Judgment. Therein, Taglienti alleges that he is entitled to summary judgment based upon the allegations contained in all the answers to the pleadings, new matters and the First Request for Admissions. Taglienti alleges further that he is entitled to relief based upon the confirmation by the Court of Common Pleas of Philadelphia County that its orders are authentic and require his immediate release without further delay.
On May 8, 2002, the DOC filed an Application for Summary Relief. Therein, the DOC alleges that Taglienti is not entitled to mandamus relief because he does not have a clear right to the relief requested, namely, he is not entitled to pre-commitment credit for the period of October 27, 1999 through November 19, 2000, because he was actively serving a Virginia sentence at that time. Taglienti filed an answer to the Application for Summary Relief restating his assertion that this matter is controlled by Section 9761(b) of the Judicial Code.
Pursuant to Pa.R.A.P. 1532(b), at any time after the filing of a petition for review in an appellate or original matter, this Court may on application enter judgment if the right of the applicant thereto is clear. When questions of fact are disputed, summary relief is not warranted. The Milton S. Hershey Medical Center of the Pennsylvania State University v. Commonwealth of Pennsylvania, 788 A.2d 1071 (Pa.Cmwlth.2001). As long as the dispute is a legal one, as opposed to a factual dispute, we are not required to deny summary relief. Id.
Summary judgment may be granted only in those cases where the record clearly shows that there are no genuine issues of material fact and that the moving party *991 is entitled to judgment as a matter of law. P.J.S. v. Pennsylvania State Ethics Commission, 555 Pa. 149, 723 A.2d 174 (1999). On a motion for summary judgment, the record must be viewed in the light most favorable to the opposing party, and all doubts as to the existence of a genuine issue of material fact must be resolved in favor of the nonmoving party. Id.
Mandamus is an extraordinary writ. Bronson v. Pennsylvania Board of Probation and Parole, 491 Pa. 549, 421 A.2d 1021 (1980), cert. denied, 450 U.S. 1050, 101 S.Ct. 1771, 68 L.Ed.2d 247 (1981). It will only be granted to compel performance of a ministerial duty where the plaintiff establishes a clear legal right to relief and a corresponding duty to act by the defendant. Waters v. Pennsylvania Department of Corrections, 97 Pa. Cmwlth. 283, 509 A.2d 430 (1986). Mandamus is not proper to establish legal rights, but is only appropriately used to enforce those rights, which have already been established. Id.
Herein, based upon the pleadings and the answers thereto, there is no factual dispute. The only dispute is a legal one whether Taglienti is entitled to credit for time served during the period he was incarcerated in Philadelphia from October 27, 1999 to November 19, 2000 when he was also actively serving and received credit for a sentence on unrelated charges in the State of Virginia. Relying on Section 9761(b) of the Judicial Code, 42 Pa. C.S. § 9761(b), Taglienti contends that he is entitled to credit for time served. Relying on precedent, the DOC argues the opposite.
We begin with Section 9760 of the Judicial Code, 42 Pa.C.S. § 9760, which governs credit for time served. Section 9760 provides as follows:
After reviewing the information submitted under section 9737 (relating to report of outstanding charges and sentences) the court shall give credit as follows:
(1) Credit against the maximum term and any minimum term shall be given to the defendant for all time spent in custody as a result of the criminal charge for which a prison sentence is imposed or as a result of the conduct on which such a charge is based. Credit shall include credit for time spent in custody prior to trial, during trial, pending sentence, and pending the resolution of an appeal.
(2) Credit against the maximum term and any minimum term shall be given to the defendant for all time spent in custody under a prior sentence if he is later reprosecuted and resentenced for the same offense or for another offense based on the same act or acts. This shall include credit in accordance with paragraph (1) of this section for all time spent in custody as a result of both the original charge and any subsequent charge for the same offense or for another offense based on the same act or acts.
(3) If the defendant is serving multiple sentences, and if one of the sentences is set aside as the result of direct or collateral attack, credit against the maximum and any minimum term of the remaining sentences shall be given for all time served in relation to the sentence set aside since the commission of the offenses on which the sentences were based.
(4) If the defendant is arrested on one charge and later prosecuted on another charge growing out of an act or acts that occurred prior to his arrest, credit against the maximum term and any minimum term of any sentence resulting from such prosecution shall be given for *992 all time spent in custody under the former charge that has not been credited against another sentence.
It is clear that the first three scenarios outlined in Section 9760 do not permit a sentencing court to provide a prisoner with credit for time served on another unrelated offense. Herein, there is no allegation that the offense for which Taglienti was serving time for in the State of Virginia and the offenses for which Taglienti was convicted of in Pennsylvania are related. The fourth scenario outlined in Section 9760 makes it clear that time credit on a sentence can only be given when it has not already been credited against another sentence.
Notwithstanding this fourth scenario and the fact that Taglienti received credit on his Virginia sentence for the time period Taglienti was incarcerated in Pennsylvania from October 27, 1999 through November 19, 2000, Taglienti argues that Section 9761(b) of the Judicial Code, 42 Pa.C.S. § 9761(b), clearly provides the sentencing judge with the sentencing authority to run time credit concurrently with other sovereigns. Therefore, Taglienti argues that he has demonstrated a right to relief as a matter of law. Section 9761(b) provides as follows:
(b) Sentences imposed by other sovereigns.If the defendant is at the time of sentencing subject to imprisonment under the authority of any other sovereign, the court may indicate that imprisonment under such other authority shall satisfy or by (sic) credited against both the minimum and maximum time imposed under the court's sentence. If the defendant is released by such other authority before the expiration of the minimum time imposed by the court, he shall be returned to a correctional institution of the Commonwealth to serve the time which remains of the sentence. If the defendant is released after the minimum time has elapsed, he shall be considered for parole on the same basis as a prisoner who has served his minimum time in a correctional institution of the Commonwealth. If the defendant is released after the maximum time imposed under the sentence of imprisonment he shall be deemed to have served his sentence.
We believe that Taglienti's reliance on Section 9761(b) is misplaced. It is clear from the language of Section 9761(b) that a sentencing court, at the time of sentencing, may indicate that any time served by a prisoner under the authority of another sovereign after the sentence is imposed may be credited against the minimum and maximum time imposed under the sentencing court's sentence. In other words, the Court of Common Pleas of Philadelphia County was authorized, at the time it sentenced Taglienti on October 27, 2000, to indicate that Taglienti's imprisonment in Virginia would be credited against both the minimum and maximum time imposed under the court's sentence. Section 9761(b) clearly provides for credit for time served under the authority of another sovereign after a sentence is imposed; however, Section 9761(b) does not provide for credit for time served prior to the sentencing date. According to the DOC, that is what occurred in this case. The sentencing court in Philadelphia made the sentences concurrent and Taglienti was given credit on the Pennsylvania sentences beginning on the date the sentence was imposed, October 27, 2000, including the time he spent in Virginia after October 27, 2000.
We note that Taglienti relies on Commonwealth ex rel. Bleecher v. Rundle, 207 Pa.Super. 443, 217 A.2d 772 (1966), to support his position. However, Bleecher reveals that it is not controlling in this matter. Bleecher involved a prisoner who was arrested in New York State on July 1, *993 1961 on an extradition warrant based on charges lodged in Montgomery and Delaware Counties, Pennsylvania. The prisoner contested extradition when he finally waived formal extradition on June 11, 1962 and was taken to Delaware County to answer criminal charges. The prisoner was found not guilty of the charges in Delaware County. Thereafter, the prisoner was transferred to Montgomery County on September 23, 1963. There he was found guilty of burglary and larceny and sentenced to a term of three to six years to be computed from September 23, 1963. The prisoner argued that his sentence should be computed from the date of his original arrest in New York State on July 1, 1961.
The Superior Court held that the prisoner was only entitled to credit if his confinement was by reason of the offenses for which he was sentenced in Pennsylvania. Upon review, the Superior Court determined that the prisoner's confinement in New York was by reason of the offenses charged in Pennsylvania; therefore, the prisoner was entitled to credit on the Montgomery County sentence for any days spent in custody in New York.
The present case is not analogous to Bleecher. Herein, Taglienti was actively serving his Virginia Sentence during the entire period from October 27, 1999 through November 20, 2000 while he was incarcerated in Pennsylvania. Moreover, the court in Bleecher, further held that the prisoner was not entitled to credit against his sentence in Montgomery County for the days that he spent in Delaware County because he was in custody on unrelated charges in Delaware County. Therefore, Taglienti's reliance on Bleecher to support his argument to the contrary is misplaced.
As stated above, credit for time served prior to the sentencing date is governed by Section 9760 which does not provide for credit for time served on unrelated offenses or when credit has been already credited against another sentence. Again, it is undisputed in this case that Taglienti did receive credit for time served on his Virginia sentence for the time period from October 27, 1999 and November 19, 2000 during which Taglienti was incarcerated in Pennsylvania awaiting sentencing for parole violations. Accordingly, if we were to find in Taglienti's favor in this case, Taglienti would be receiving double credit.
The fact that the Court of Common Pleas of Philadelphia County ordered that credit be given to Taglienti for time served is of no moment. Based upon our forgoing discussion, it is clear that the sentencing court was precluded from ordering credit for the period of Taglienti's imprisonment in Pennsylvania while he was actively serving time on his sentence in Virginia. It is well settled that this Court lacks the authority to compel an illegal act through a writ of mandamus. Doxsey v. Pennsylvania Bureau of Corrections, 674 A.2d 1173 (Pa.Cmwlth.1996). Our courts have consistently held that the DOC cannot be compelled to award double credit and that mandamus is not available where a prisoner is seeking to have the DOC apply credit to another sentence for an unrelated offense that the prisoner was serving at the time he was sentenced. See Commonwealth v. Bowser, 783 A.2d 348 (Pa.Super.2001), petition for allowance of appeal denied, 568 Pa. 733, 798 A.2d 1286 (2002); Jackson v. Vaughn, 565 Pa. 601, 777 A.2d 436 (2001); Doxsey; Wassell v. Pennsylvania Board of Probation and Parole and Pennsylvania Department of Corrections, 658 A.2d 466 (Pa.Cmwlth. 1995); Doria v. Pennsylvania Department of Corrections, 158 Pa.Cmwlth. 59, 630 A.2d 980 (1993), aff'd without opinion, 539 Pa. 245, 652 A.2d 281 (1994).
Thus, we deny Taglienti's Motion for Summary Judgment, grant the DOC's Application *994 for Summary Relief, and dismiss Taglienti's Petition for Review with prejudice.

ORDER
AND NOW, this 13th day of September, 2002, it is hereby ordered that:
1. The Motion for Summary Judgment filed by Anthony F. Taglienti is DENIED;
2. The Application for Summary Relief filed by the Pennsylvania Department of Corrections is GRANTED; and
3. The Petition for Review Seeking Mandamus Relief filed by Anthony F. Taglienti is DISMISSED WITH PREJUDICE.
NOTES
[1]  Taglienti also filed an Application to Proceed Informa Pauperis on December 5, 2001, which this Court granted by order of December 10, 2001.
[2]  The court orders attached to the Petition for Review show that Taglienti was in violation of his parole stemming from his convictions for burglary, theft and unlawful taking.
