hello everone i have a table named "Concerned_Department" in which i ve a filed "Deadline"of type DateTime.i ve another table named "Cat_description" in wh i ve a filed "Max_Days"of type int in wh i ve values 1,2 and 3.in "Cat_Description" table i ve "Cat_ID" as Primary key of type int.all i want is if i select a row from "Cat_description" with "Max_Days"=1, i want to add this 1 to current date and and place it in the "deadline" field of "Concerned_Department" table.like if today is 12/02/2008 then i want to place 13/02/2008 in "Deadline" filed of "Concerned_Deprtment"tablewhen a row with "Max_Days"=1 from "Cat_Description" is selected.i am using SQL SERVER 2005 Exprees and C#(in source behind).regardsAhmed Bilal Jan
how is it possible to set a filed in a database to automatically add the current time to the filed at run time, is this possible; this filed has already been identified as 'DateTime' .
i want to fetch visitors record by data but visiting date field has time also and i want to get by data only because i am unknown to exact time. i am using this query but record does not comes. select * from visitors where in_date_time like '03-05-2007%' where as i am using visitor name instead of in_data_time it works success fully. plz solve it. Jasim... New Delhi...
Hi everybody. I am new in SQL SERVER and I have a problem with a datetime
I have a select. It works in a database but it doesn´t work in other database.
The error is the next :
2004-04-20 13:37:32,781 INFO [STDOUT] ConexionBDExceptionjava.sql.SQLException: [Microsoft][SQLServer JDBC Driver][SQLServer]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value
The select is:
SELECT id_solicitud from solicitudes where fecha_apertura >= '01/03/04' AND fecha_apertura <= '31/03/04 23:59:59.999' ORDER BY fecha_apertura DESC
I have some problem with datatime.SELECT * FROM stat WHERE data > '2005-05-24 14:07:28' ORDER BY id AscI got the error:Microsoft OLE DB Provider for SQL Server error '80040e07'The conversion of a char data type to a datetime data type resulted in anout-of-range datetime value.Why? Format of date is the same in database?Regards,
DataTime for linked Server I have a SQL server in Country A (Server A) and another Server in Country B (Server B) Server A has Server B as linked server, I run a stored procedure in Server A and getdate()gives me current date/time for Server A, how can I do getdate() for Server B?
DataTime for linked Server I have a SQL server in Country A (Server A) and another Server in Country B (Server B) Server A has Server B as linked server, I run a stored procedure in Server A and getdate()gives me current date/time for Server A, how can I do getdate() for Server B?
I pages and use Ms sql Express and would like to have it condition-shape defual value to be the date, but if I choose the field have to be date-hour and then defual value chooses have nowly () to be it doesn't give myself any law, some that know what I do mistakes here?
My database has chinese characters in. Eventually I need to only get the first 50 bytes of the data field, but somehow, I use len('==data==',50), it would catch 50 chinese characters which make 100 bytes ... can anyone help me? Thank you very much no matter what the result is ;)
i have two tables .Table 1 contains certain columns with values.Table 2 shud get those data from table1 into its column and display the calculated result. Any idea how do i go abt it,bcuz table2 shud contain a formula so as to calculate.
I have a table with two primary key fileds. I will be running a process to populate the data into the table.For each process the first field is constant and second field is auto increment one.
My statements are insert into select ** from ** type one.
How do I auto increment second filed per run. Any delivered function available or any suggestion Pl.................
I'm having two datetime field in my table. One is Call date and another one is Calltime because of some calculations. So I want to save calldate like 4/14/2008 and calltime like 9:30 PM.
I have a database called ‘Objects’ which has many field. One of its fields is called ‘Image’ and has a data type image. I want to add pictures to each one of my records offline, is this possible? i.e. by copying the address from my C drive such as C:Documents and SettingsfseyedarabiMy DocumentsMy Pictures
i ve a filed named "Email" of datatype .i ve created this field to insert email address in this field.but when i insert an email address like "bilal@yahoo.com" from a textbox wh is in an ASP.net webpage then in the filed i see this "System.Web.UI.WebControls.TextBox". can u plz tell me how to fix this Regards Ahmed Bilal Jan
i am trying to insert an auot number field in my table which has got about million rows but sql 2005 is giving me na error "cant insert" i need to index my table so that the query runs faster when i perform joins on two of such huge tables.. i tryid inserting the identity key the way it was mentioned in the forum but sql doesnt let me do that??
How can I validate the date that is coming across in a 8 byte character field via an expression? It will either be a valid date or 0. If it is zero I want to make it a null.
I have a database called 'objects' with one of its fields called 'Image' (data type is set to image) and a file in my desk top labelled as 'Pictures' (this is where all my pictures are keep). At run time i want to be able to select and add (upload) my preferred picture to the image filed of different records. Could you please advice me what i should do?
I have to run a dynamic sql that i save in the database as a TEXT data type(due to a large size of the sql.) from a .NET app. Now i have to run this sql from the stored proc that returns the results back to .net app. I am running this dynamic sql with sp_executesql like this.. EXEC sp_executesql @Statement,N'@param1 varchar(3),@param2 varchar(1)',@param1,@param2,GO As i can't declare text,ntext etc variables in T-Sql(stored proc), so i am using this method in pulling the text type field "Statement". DECLARE @Statement varbinary(16)SELECT @Statement = TEXTPTR(Statement)FROM table1 READTEXT table1.statement @Statement 0 16566 So far so good, the issue is how to convert @Statment varbinary to nText to get it passed in sp_executesql. Note:- i can't use Exec to run the dynamic sql becuase i need to pass the params from the .net app and Exec proc doesn't take param from the stored proc from where it is called. I would appreciate if any body respond to this.
Hi everyoneI am trying to create a DELETE Trigger. I have 2 tables. Table1 andTable2. Table 2 has all the same fields and records as Table1 + 1extra column "date_removed"I would like that when a record is deleted from Table 1, the triggerfinds that record in Table2 and updates the date_removed filed withcurrent time stamp.The primary key on both is combination of domain,admin_group and cn.CREATE TRIGGER [tr_updateTable2] ON [dbo].tbl_Table1FOR DELETEASUpdate Table2SET date_removed = getDate()I'm stuck here, how do I manipulate on Table2 only the records thatwere deleted on Table1, so to only update date_removed filed for themin Table2?I guess i need to compare domain, cn and admin_group, but I don't knowhow.Any help would be greatly appreciatedThanks! :-)