Solved

SQL Reporting Services - Supply values to DateTime parameter

Posted on 2008-06-20
2
1,734 Views
Last Modified: 2008-06-25
I have a query which is supposed to supply default values to Date_From and Date_To parameters for a report query.

The SELECT statement below provides date in the format YYYY/MM/DD , apparently this is not the format expected by the DateTime parameter.

What is value would DateTime be looking for?
0
Comment
Question by:egxis
2 Comments
 
LVL 6

Accepted Solution

by:
psychic_zero earned 250 total points
ID: 21829540
I think the format it looking for is in format MM/DD/YYYY HH:MM:SS AM
eg. 6/20/2008 5:40:10 PM
0
 
LVL 15

Assisted Solution

by:rob_farley
rob_farley earned 250 total points
ID: 21829558
Try using the format YYYYMMDD - without the slashes. Almost everything else is location-dependent.

If that still doesn't like it, try:

select cast('20080620' as datetime)

...to force it to evaluate it as a datetime, rather than a string.

Rob
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now