Solved

SQL Reporting Services - Supply values to DateTime parameter

Posted on 2008-06-20
2
1,733 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 14

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

747 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

12 Experts available now in Live!

Get 1:1 Help Now