
678 N.W.2d 611 (2004)
STATE of Iowa, Appellant,
v.
Kris Eugene PETERSEN, Appellee.
No. 03-0912.
Supreme Court of Iowa.
April 7, 2004.
Thomas J. Miller, Attorney General, Kevin Cmelik, Assistant Attorney General, and Marci Prier, County Attorney, for appellant.
Joseph J. Hrvol, Council Bluffs, for appellee.
WIGGINS, Justice.
The State filed a complaint charging Kris Petersen with assault with intent to commit sexual abuse. Petersen moved to dismiss the charge alleging the complaint and affidavit failed to establish probable cause that a crime was committed. Before the district court held a hearing on Petersen's motion, the court approved and the State filed the trial information. After the State filed the trial information, the district *612 court conducted a hearing on Petersen's motion to dismiss. The district court dismissed the trial information, because it found that the complaint and affidavit failed to establish probable cause a crime had been committed. Because we conclude the district court should not have dismissed the trial information, we reverse its decision.

I. Background Facts and Proceedings.
On September 20, 2002, an eight-year-old female spent the night at a friend's house, the daughter of Petersen. Upon returning home, she told her mother that during the night, while sleeping in the basement with her friend and her friend's little brother, Petersen lay down between her and her friend. Petersen then removed her bed sheet, lifted his shirt, lay on top of her sideways, and did what she described as a "belly wave." Petersen then proceeded to lick his finger and rub her inner thigh. The victim's mother reported Petersen's alleged conduct to the authorities.
On December 3, 2002, the State charged Petersen with indecent contact with a child, in violation of Iowa Code section 709.12 (2001). A magistrate held a preliminary hearing on December 23, 2002. On January 9, 2003, the magistrate dismissed the charge finding no substantial evidence to support a finding that Petersen acted with specific intent to arouse or satisfy the sexual desires of himself or the child.
On March 28, 2003, the State filed a second complaint against Petersen charging him with assault with intent to commit sexual abuse in violation of Iowa Code sections 708.1 and 709.11. Strangely, the affidavit attached to this complaint indicated the notary notarized the affidavit on September 21, 2002, even though the affidavit set forth events that took place on September 20, September 21, September 23, and October 16, 2002. Despite this obvious defect, a different magistrate from the one who dismissed the previous charge issued a warrant for Petersen's arrest.
On April 3, 2003, Petersen filed a document entitled "motion to dismiss and notice to the district court." In his motion, Petersen asked the court to dismiss "this matter" because the affidavit indicated it was notarized on September 21, 2002, but it alleged events that occurred after that date; the second charge was substantially similar to the charge previously dismissed; and the officer who presented the affidavit to the magistrate failed to advise the magistrate that a similar charge was dismissed at a preliminary hearing. Petersen requested a hearing on the motion before approval of the trial information.
The district court approved the trial information on April 14, 2003. The State filed the trial information and minutes of testimony on the same day. On April 16 the court administrator set the motion to dismiss and notice to the district court for hearing on April 28. On the day of the hearing, the State filed a resistance to Petersen's motion. The resistance contended that the act of filing the trial information extinguished Petersen's right to a preliminary hearing; that any errors in the complaint and affidavit became moot upon filing the trial information; and double jeopardy did not attach, because the second offense charged was not a lesser-included offense of the first offense charged.
In ruling on the motion, the district court found the affidavit attached to the complaint was defective because of the discrepancy between the date of its notarization and the date of the acts contained in the affidavit. For this reason, the district court concluded the complaint and affidavit failed to establish probable cause to charge *613 or arrest Petersen and dismissed the trial information. The State appeals this order.

II. Issues.
The State claims the district court erred in dismissing the trial information where the complaint and affidavit allegedly failed to establish probable cause that a crime was committed. Petersen contends the district court had authority to dismiss the trial information under Iowa Rule of Criminal Procedure 2.11(2)(a) "based on defects in the institution of the prosecution." Alternatively, Petersen asserts the court had authority on its own motion to dismiss the trial information under the last sentence of Iowa Rule of Criminal Procedure 2.5(4). Finally, Petersen argues Iowa Rule of Criminal Procedure 2.11(6)(a) allows the court to dismiss the trial information and minutes of evidence when the trial information and minutes of evidence do not constitute the offense charged in the trial information.

III. Scope of Review.
A review of a district court's decision to dismiss a trial information is for errors at law. State v. Wells, 629 N.W.2d 346, 351 (Iowa 2001).

IV. Analysis.
Petersen did not make a motion attacking the trial information filed in his case. Petersen based his motion on defects in the complaint and affidavit, not on any defects in the trial information or minutes. Even if we assume the district court considered Petersen's motion as a motion to dismiss the trial information, Petersen's motion failed to raise any grounds that would warrant dismissal of the trial information.
Petersen first argues the district court was correct in dismissing the trial information under rule 2.11(2)(a), which allows a defendant to make a pretrial motion "based on defects in the institution of the prosecution." We have allowed a defendant to raise a claim of double jeopardy by a rule 2.11(2)(a) motion. State v. Harrison, 578 N.W.2d 234, 237 (Iowa 1998). We have never decided the issue of whether a rule 2.11(2)(a) motion will allow the court to dismiss the trial information, when the complaint and affidavit fail to establish probable cause that a crime was committed.
Petersen's argument confuses the separate functions of the complaint and the trial information. The filing of the complaint is necessary for the court to issue an arrest warrant for a defendant. Iowa Code § 804.1; State v. Henderson, 268 N.W.2d 173, 176 (Iowa 1978). A preliminary hearing is required in order to determine the legality of detaining a person accused of a felony or an indictable misdemeanor before the State files a charge by a trial information or a grand jury indictment. State v. Franklin, 163 N.W.2d 437, 439 (Iowa 1968). If the preliminary hearing reveals there is no probable cause to believe that an offense has been committed or that the defendant committed it, the court dismisses the complaint and discharges the defendant from custody. Iowa R.Crim. P. 2.2(4)(e).
The filing of the trial information is necessary to charge a defendant with an indictable offense. Iowa R.Crim. P. 2.5(1). The State can file charges by trial information without first filing a complaint. State v. Collins, 260 Iowa 1366, 1369, 152 N.W.2d 612, 614-15 (1967). Once the State files the trial information, a preliminary examination is unnecessary. State v. Rouse, 290 N.W.2d 911, 912-13 (Iowa 1980); State v. Dowell, 297 N.W.2d 93, 97 (Iowa 1980); Henderson, 268 N.W.2d at 176; State v. Montgomery, 232 N.W.2d *614 525, 526 (Iowa 1975). When the court approves the trial information, it determines whether there is probable cause to detain the defendant to answer the charge. State v. Shank, 296 N.W.2d 791, 792 (Iowa 1980). A violation in the complaint stage of the proceedings does not affect the merits of the charge, but only affects the legality of the detention of the accused to answer the charge prior to the filing of the information. Dowell, 297 N.W.2d at 97.
When the district court approved the trial information, it determined there was probable cause to detain Petersen and require him to answer to the charge of assault with intent to commit sexual abuse. Once filed, the trial information was the pleading formally charging Petersen with a crime. At that point in the proceedings, any defect in the affidavit attached to the complaint was moot and not grounds for dismissal of the trial information as a defect in the institution of the prosecution of the action.
Petersen also argues the district court had authority to dismiss the trial information under the last sentence of rule 2.5(4), which allows a judge at any time on its own motion, after approval and prior to trial, to order the trial information set aside and the case submitted to the grand jury. The flaw with this argument is that the district court dismissed the trial information without ordering the case submitted to the grand jury. Thus, the record does not support Petersen's claim that the district court dismissed the trial information under rule 2.5(4).
Finally, Petersen argues rule 2.11(6)(a) allows the court to dismiss the trial information and minutes of evidence when the trial information and minutes of evidence do not constitute the offense charged in the trial information. Petersen did not raise this issue in the district court. The district court did not have the opportunity to review the trial information under rule 2.11(6)(a). We have consistently held that on reviewing matters, such as motions to dismiss, we will not decide a case based on a ground not raised in the lower court. DeVoss v. State, 648 N.W.2d 56, 61 (Iowa 2002). Therefore, we will not consider this issue for the first time on appeal.

V. Disposition.
Because we conclude the district court should not have dismissed the trial information simply because the complaint and affidavit failed to establish probable cause a crime had been committed, we reverse the decision of the district court and remand this case for further proceedings consistent with this opinion.
REVERSED AND CASE REMANDED.
