
    Arthur DOXSEY, Petitioner v. COMMONWEALTH of Pennsylvania, Pennsylvania Bureau of Corrections, et al., Respondents.
    Commonwealth Court of Pennsylvania.
    Submitted on Briefs March 6, 1996.
    Decided April 15, 1996.
    
      Arthur Doxsey, Pro Se, as Petitioner.
    Clifford D. Swift, Assistant Counsel, for Respondent.
    Before COLINS, President Judge, and DOYLE, J., and KELTON, Senior Judge.
   COLINS, President Judge.

Before this Court in our original jurisdiction is a preliminary objection filed by the respondent, Department of Corrections, to a petition for review, as amended, filed by pro se petitioner, Arthur Doxsey.

Petitioner alleges that respondent has not properly calculated his “minimum sentencing date.” Respondent has attached to its preliminary objection copies of the official criminal court records, which contain the relevant dates for purposes of determining petitioner’s sentencing date and ascertaining whether he was incorrectly deprived of pre-sentence credit. We grant respondent’s request and take judicial notice of these documents.

In 1990 petitioner was confined in a correctional facility in the state of Maryland serving a six- to twelve-year sentence because he had pled guilty to a sex offense. He alleges that on July 20, 1990 Pennsylvania lodged a detainer against him. The sentencing transcript, of which we have taken judicial notice, however, reveals that the detainer was lodged on October 2, 1990. In any event, petitioner pled guilty to rape and involuntary deviate sexual intercourse and was sentenced on August 26, 1991 to a term of five to ten years by the Court of Common Pleas of York County. The York County judge directed that his sentence was to run concurrently with the Maryland sentence. Consequently, petitioner asserts that his pre-commitment time “for period he had been incarcerated between his arrest and the granting of bail, and for time he had served between imposition of sentence and grant of supersedeas by the Supreme Court” should be credited toward his Pennsylvania sentence. Specifically he seeks to have his records reflect that his minimum time on the York County sentence would expire on July 20, 1995, apparently making him eligible to apply for parole.

In essence, what petitioner seeks is to have his York County pre-sentence confinement time credited toward his York County sentence. This is clearly what the sentencing judge intended, as the following colloquy reveals:

It is the Court’s understanding that the Defendant will receive credit for the sentence imposed from the date the detainer was lodged in Maryland, and the Court is advised the detainer was lodged on October 2nd, 1990. If that turns out to be incorrect, obviously, the authorities will give the Defendant appropriate credit for time served.

Respondent has filed a demurrer to the petition maintaining that the order is illegal and that it cannot be compelled to follow it. A demurrer may only be sustained when on the face of the complaint the law will not permit recovery. Stone & Edwards Insurance Agency, Inc. v. Department of Insurance, 151 Pa.Cmwlth. 266, 616 A.2d 1060 (1992), affirmed, 538 Pa. 276, 648 A.2d 304 (1994). All well-pled allegations must be accepted as true. Id. We note that mandamus will lie only where the petitioning party demonstrates its clear right to relief, a correspondingly clear duty on the part of the party against whom mandamus is sought, and the want of any other adequate remedy. Francis v. Corleto, 418 Pa. 417, 211 A.2d 503 (1965). Mandamus can only be used to compel performance of a ministerial duty and will not be granted in doubtful cases. Id.

Pennsylvania Rule of Criminal Procedure 1406(c) pertinently provides:

When, at the time sentence is imposed, the defendant is imprisoned under a sentence imposed for any other offense or offenses, the instant sentence which the judge is imposing shall be deemed to commence from the date of imposition thereof unless the judge states that it shall commence from the date of expiration of such other sentence or sentences.

It is clear that under this rule a sentencing judge cannot direct that a sentence commence on a date prior to the date of sentencing when the defendant is serving time on an unrelated charge. Doria v. Department of Corrections, 158 Pa.Cmwlth. 59, 630 A.2d 980 (1993), aff'd per curiam, 539 Pa. 245, 652 A.2d 281 (1994); Wassell v. Pennsylvania Board of Probation and Parole, 658 A.2d 466 (Pa.Cmwlth.1995). Respondent relies on this rule in refusing to honor the sentencing judge’s order. The question we must decide is whether, when a sentencing judge issues a clearly illegal order, mandamus will lie against the Department of Corrections to compel it to honor that order. We hold that it will not.

Mandamus will lie where there exists a right on behalf of the party seeking relief in mandamus. Thus, a writ of mandamus can be used to compel the Department of Corrections to compute properly a prisoner’s prison sentence. No one, however, has a right and this Court, indeed, lacks the authority to compel an illegal act. Because rule 1406(c) makes it clear that the judge was precluded from ordering and, consequently, that respondent is precluded from applying, credit for the period of imprisonment for a second or subsequent conviction if the individual is already in prison under a sentence imposed for other offenses, mandamus will not he against respondent to compel it to abide by the sentencing order.

This is not to say that petitioner has no remedy. In a situation where, because a sentence is illegal, a prisoner does not receive the benefit of his plea bargain, the proper avenue would appear to be to seek relief in the sentencing court. While the court cannot declare the vehicle for obtaining such relief, what is clear is that the remedy is not one in mandamus against the Department of Corrections to compel it to honor an illegal order.

Based upon the above analysis, we conclude that the demurrer must be sustained.

ORDER

Now, April 15,1996, the preliminary objection in the nature of a demurrer to the petition for review, as amended, is sustained and the petition is dismissed. 
      
      . A preliminary question which may appear to need to be addressed is whether respondent has standing to question the validity of the sentencing order. This, however, is not really a question in these proceedings because respondent is not the petitioning party here. Thus its authority to question the order comes into play only in its response (demurrer) to the petition for review. We do note, however, that we have permitted the Pennsylvania Board of Probation and Parole to refuse to follow a retroactive paroling order where it correctly asserted that such an order was illegal. See e.g., Bailey v, Pennsylvania Board of Probation and Parole, 140 Pa.Cmwlth. 108, 591 A.2d 778 (1991).
     
      
      . Had respondent been incorrect in its position that the order was illegal the result here may well have been different. In sua sponte asserting the illegality it does take some risk that the Court will not agree with its assessment. Here, however, its position is correct.
     