I have a chart that I am grouping data by Year, Month, day then Hour (this is to view server performance data) - however i need the label for the hour grouping to be in the format of HH:MM and not H:M by using expression
I have a chart that I am grouping data by Year, Month, day then Hour (this is to view server performance data) - however i need the label for the hour grouping to be in the format of HH:MM and not H:M by using expression
Is there a way to define a query-filter (Example: WHERE column1 > 5 AND column2 = 'value') in a function?
So I can create a query like this:
SELECT *  FROM Table  WHERE MyFunction()
I know it's a bit of a strange question, but I'm writing a dynamic software that will have the ability to run Stored Procedures on any database to create some data-checks. Through parametrisation, a user can define for a specific Stored Procedure that some results are no longer necessary in the result-set.
Example: ID - Name - State 1 - Jozef De Veuster - Mad 2 - Piet Husentruut - Not Happy 3 - Jeroen Meus - Angry
Is the result of a Stored Procedure "Show_me_unhappy_persons". But we already know that Jozef De Veuster is ALWAYS Mad, so a user can say: Exclude ID = 1, so it won't appear anymore in the result.
I want to handle this by doing:
SELECT * FROM PeopleStates WHERE --Some stuff-- AND CheckUserExclusions(SomeID) And CheckUserExclusions will translate to "NOT (ID = 1)"
I need create a field to store tax rate. I need only 2 decimal points. I defined the field as decimal, precision=5 and scale=2. Does it mean that it can hold value from 0.00 to 999.99?
I've got the following problem and the SQL Server books aren't really helping me on this subject. I have to create a chart that shows the top 10 cities with the most clients. I'm able to get all cities in the chart but filtering to the top 10 doesn't work.
In the properties of my chart (Data tab) I have: - Values: =Count(Fields!customerid.Value) - Series:
Group on: =Fields!city.Value Filter on: =Count(Fields!city.Value) | TOP N | 10
I always get a error message about a wrong filter expression.
I have a table that has a group. In this group, I want to filter by 2 different expressions, concatenated with an OR. BUT I can't change the "And/Or" column value for the first entry because it is grayed out. The column will automatically change to an OR value if both my expression column fields are the same (which I don€™t want) but if I put any other value in to the expression field of the second row, the "And/Or" field of the first row automatically changes to an AND.
PLEASE! How do I get the And/Or field "ungrayed" so I can change it to what I want?
The 2 filters I and using check the UserID = to the user, and the other is checking a count to get the Top N 1. (So just showing the current user and the top producer)
Is it possible to have different chart (having their dataset from same shared datasets) like six on one report, then secondly can they all respond to same parameter filter.
I am designing a database. I want to define a automatic sequence on a table primary key field. what is the best solution for it?
I know I can enable identity property for a field, but it has some problems ( for example its seed jumps on restart and unsuccessful events)
I also can use some calculated sequences. for example I can calculate max of the filed values and after incrementing use it as key for new inserted record.
I am making a scatter chart (not using Dundas) to plot at what time (Y-axis) and what date (X-axis) something happened. The DateTime value is coming from a database. I currently have it working if I use the Hour() for the Y-axis, and the DateValue() for the X-axis.
What I'd like to do is make it so that on the Y-axis, I can display the standard time format (i.e. 7:30am), and on the X-axis, display just the date (6/28/2007) rather then the date with midnight on it.
I am using stored procedure dataset. i tried filtering the dataset values with the parameter of type datetime.I am able to view and select multiple datetime value from the list. but its not filtering the values.
i changed the parameter datatype to string but it works only for the first value
(parameter. <pname>.value(0)). if i filter with the array value (parameter. <pname>.value) am getting error (Failed to evaluate Filter expression).
I guess the problem with datatype. Pls help me if anyone have idea about this.
Hi all, having a little problem with saving dates to sql databaseI've got the CreatedOn field in the table set to datetime type, but every time i try and run it i get an error kicked up Error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated."I've tried researching it but not been able to find something similar. Heres the code: DateTime createOn = DateTime.Now;string sSQLStatement = "INSERT INTO Index (Name, Description, Creator,CreatedOn) values ('" + name + "','" + description + "','" + userName + "','" + createOn + "')"; Any help would be much appreciated
I am trying to drag data from Informix to Sql Server. When I kick off the package using an OLE DB Source and a SQL Server Destination, I get DT_DBDATE to DT_DBTIMESTAMP errors on two fields from Informix which are date data ....no timestamp part
I tried a couple of things:
Created a view of the Informix table where I cast the date fields as datetime year to fraction(5), which failed.
Altered the view to convert the date fields to char(10) with the hopes that SQL Server would implicitly cast them as datetime but it failed.
I have a table which includes an encrypted field. In the following statement...
select cast(decryptBykey(Column2)as varchar(max)) as column2new, column1 from testtable where cast(decryptBykey(Column2) as varchar(max))=@p1
I retrieve the (now decrypted) secure column as well as another column and then filter the results by a parameter on the (now decrypted) secure field.
Furthermore, if I wanted to sort on the encrypted field, I would once again have to call the cast(decryptbykey... function. It seems to me that this kind of statement would perform poorly since I have to call the same function numerous times. Is there a way to call this function once and then reference the resultant field value throughout the rest of the statement?
I assume that this situation is the same if I call any SQL function to alter a field value..not just the decryptbykey function
SSRS/SSAS. I'm using aggregate function no problem in a Table, but when I try to use same function in data field of a chart I get no results. I know that "aggregate" has only been supported since SP2, is there a known problem with using it in charts?
I am putting a SELECT statement together where I need to evaluate a results field, to determine how the color indicator will show on a SSRS report. I am running into a problem when I try to filter out any non-numeric values from a varchar field, using a nested CASE statement.
For example, this results field may contain values of '<1', '>=1', '1', '100', '500', '5000', etc. For one type of test, I need a value of 500 or less to be shown as a green indicator in a report, and any value over that would be flagged as a red. Another test might only allow a value of 10 or less before being flagged with a red.
This is why I setup a CASE statement for an IndicatorValue that will pass over to the report to determine the indicator color. Using CASE statements for this is easier to work with, and less taxing on the report server, if done in SQL Server instead of nested SSRS expressions, especially since a variety of tests have different result values that would be flagged as green or red.
I have a separate nested CASE statement that will handle any of the values that contain ">" or "<", so I am using the following to filter those out, and then convert it to an int value, to determine what the indicator value should be. Here is the line of the script that is erring out"
case when (RESULT not like '%<%') or (RESULT not like '%>%') then CASE WHEN (CONVERT(int, RESULT) between 0 and 500) THEN '2' ELSE '0'
The message I am getting is: Conversion failed when converting the varchar value '<1' to data type int.
I thought a "not like" statement would not include those values for converting to an int, but that does not seem to be working correctly. I did also try moving the not to show as "not RESULT like", and that did not change the message.
How I can filter out non-numeric values before converting the rest of the varchar field (RESULT) to int, so that it is only converting actual numbers?
OUr end-users will be accessing data through a SQL view through third party applications. Ex. Access, Excel, Crystal Reports. All the date fields need to only have 'Data' XX/XX/XXXX, not datetime. Since SQL Server only stores the data as datetime, I convert the data in the proper format in the Create view statement. The only problem is that the data is now a text (varchar(10) field in which sorting through these third party applications causes issues. Ex. 01/05/2000 comes before 02/02/1999 because it sorts on the first characters. Is there a way in SQL to store the data as a Date only or any other suggestions.
hello there. i have a databse with a datetime Filed and i want to find all records of the month on the datetie filed. how can i do it. i was using this but it does not work
SELECT * FROM laconexion.lc_members WHERE (baja = MONTH(GETDATE()))
I keep getting the following error message but I don't see what's wrong with my code
Server Error in '/Admin' Application.
Arithmetic overflow error converting expression to data type datetime.The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Arithmetic overflow error converting expression to data type datetime.The statement has been terminated.Source Error:
Line 147:cmdSql.Parameters.Add("@event_active","1") Line 148: Line 149:cmdSql.ExecuteNonQuery() Line 150: Line 151:pnlForm.Visible = FalseSource File: c:hostingwebhost4lifememberNYACOAadmincalendar.aspx Line: 149 Stack Trace:
dear friends.................. i have a table like below.. name date ------------------------------------------------------------------------------------------------------------ anbumani 2/18/2008 4:15:56 PM anbumani 2/18/2008 4:21:29 PM anbumani 2/18/2008 4:23:03 PM anbumani 2/18/2008 4:25:25 PM i want a out put as only time (ex : 4:15:56 PM 4:21:29 PM 4:23:03 PM ) give me the stored procedure code in sql server 2005.. thanks and regards Samuel Chandradoss . J
Trying to extract the time portion from a datetime field. ex 7:15:12 AM from 1/1/2008 7:15:12 aM This is what I tried and neither functions give me the results I want.... SELECT DueTime, CONVERT(varchar, DueDate, 108) AS Expr1, SUBSTRING(CAST(DueDate AS varchar), 10, LEN(DueDate)) AS Expr2, CAST(DueDate AS varchar) AS Expr3FROM TODO Due Time Expr1 Expr2 Expr3 1/1/2008 5:15:00 PM 00:00:00 12:00:00 AM Jan 1 2008 12:00:00 AM It seems Cast(DueDate as varchar) is the problem it converts the time to the default 12:00:00 AM In the above example I want 5:15:00 PM
Here is my nightmare!! : I have 3 database tables. ( START, STOP, TICK )START ( Start_ID, Start_Time )STOP ( Stop_ID, Stop_Time )TICK ( Tick_ID, Tick_Time ) I have 3 records in each tables with the time fields being in datetime format. What I want to accomplish: I want to compare Tick_Time to see if it is between Start_Time and Stop_Time. ie. IF Tick_Time > Start_Time AND Tick_Time < Stop_Time THEN that Tick_Time.colour = Green elseTick_Time.colour = Red Can datetime fields be easily compared like I have shown above? Else can anyone give me an idea of howwwww Thanks and any help is appreciated
Hi, I have used smalldatetime datatype to store my date and time values. i want to store just the date or time but the problem is it stores both the date and time. For eg, if i add the the date 03/11/2004, it also the stores the current time automatically. so the new value will be something like 03/11/2004 10:00:00 AM where i want just 03/11/2004. further problem is even though i managed to store just the date like 03/11/2004 in the database, whole date and time shows up when i display it in my pages.
Hi! Can anyone tell me how to perform a substring operation on a DateTime field. I'm using SQLServer. I have read that you may have to use casts but I have thus far been unable to get that to work. My statement: SELECT EventDate FROM tblEvent WHERE Category = 'GE'; I just want to cut the hours, minutes and seconds off, so that I am left with just the date element. Thanks all. Gren