When to use a one tailed or two tailed confidence interval I'm currently doing a project for my AP Stats class.  I performed a 2 sample t test for difference of means with an alpha value of .05.  I rejected my null hypothesis that the means of two populations were equal, in favor of the population mean of A being greater than that of B.
I am supposed to provide a confidence interval to support my answer, but I am having trouble with this.  My current understanding is that we always use two sided confidence intervals.  However, the two sided confidence interval results in (-.02 , 1.02).  Because 0 is included in the interval, it refutes my conclusion from the test.  But an upper bound one sided interval does not contain 0.  
My real question is: is it possible for my interval to suggest a different conclusion than my test at the same confidence level?  And when do we use a one sided confidence interval?
 A: The theory behind this goes beyond what is covered in AP Statistics, but a $(1-\alpha)\%$ confidence interval partitions the real line$^{\dagger}$ into a set of values that would be rejected by a hypothesis test at $\alpha$ (outside of the confidence interval) and that would not be rejected by a hypothesis test at $\alpha$.$^{\dagger\dagger}$ The confidence interval you calculated is based on the two-sample t-test, meaning that the inference from the confidence interval must agree with the result from the t-test. Good for you for thinking something was fishy when the methods disagreed!
It sounds like you did your hypothesis test with a one-sided alternative hypothesis but did a two-sided confidence interval. There is an inconsistency there. Do both the alternative hypothesis and confidence interval as one-sided or two-sided, but don't do one as one-sided and the other as two-sided.
You ask when to use a one-sided test versus a two-sided test. This comes down to your research question. If you only care about a change in one direction, a one-sided test is more powerful than a two-sided test. If you care about changes in general, either increases or decreases, then a two-sided test is appropriate. After you reject the null of equality, you can infer the direction of change by looking at the sign. However, it is poor practice to look at the sign and then pick the corresponding one-sided test in order to increase the power to reject the null hypothesis.
Once you know your research question and come up with your null and alternative hypotheses, then just be consistent when you calculate the p-value and the cofidence intervals.
$^{\dagger}$It can be done in more generality than the real line.
$^{\dagger\dagger}$ There are exotic confidence intervals where this is not true. See the comments that Alexis made to my response here.
A: The type of test depends upon the alternate hypothesis if h_a uses not equal then you use 2 tailed confidence interval and if it is either one of greater than or less than, then you use 1 tailed confidence interval. 
For the above problem, you will use 1 tailed. Also, note you have to reduce the alpha value to half that is 0.025 when using 2 tailed.
A: You can first look at the formula for T-Test (calculation of T-statistics) and consider your alternate hypothesis. $$\frac{\bar{X_a}-\bar{X_b}}{\sqrt{\frac{s^2_a}{n_a}+\frac{s^2_b}{n_b}}}$$
The alternate hypothesis for your case is that $\mu_a > \mu_b$. The "evidence" that can support this hypothesis is that we found $\bar{X}_a$. So from this your confidence interval should have been of the form $(-\infty,t)$. Note that confidence interval is the area, that determines your rejection region or area that which you fail the null hypothesis.
I think link this provide a nice explanation.
