|
Dates as strings....
You could CONVERT the varchar types into date types for the query.
|
|
|
|
|
AAH!
Let me try this...
Hopefuly, it should work!
colgateas900197
|
|
|
|
|
No Bro!
i have tried this(Orders.OrderDate >= (CONVERT(varchar,'26/03/2007',101)) AND Orders.OrderDate <= (CONVERT(varchar,'26/04/2007',101))) but facing same problem.
colgateas900197
|
|
|
|
|
Yes, that's cause you're converting your nvarchar fields to varchar, rather than datetime...
|
|
|
|
|
OH, oooooooo OH,OH
Thanks dear!
Its working.... OH,
Thanks.
For others it happens sometimes but for me it happens most of the times that brain dosnt work.
Thanks for your kind help
colgateas900197
|
|
|
|
|
can u send me ur proper quary.
i have tried this as below...but it does not returns any row:
Select * from tablea where
OrderDate >= (CONVERT(datetime,'26/03/2007',120)) AND OrderDate <= (CONVERT(datetime,'26/04/2007',120))
|
|
|
|
|
I have DataSet containing a table. I want to change the datatype of 2nd column of the table to varchar before binding the dataset to my datagrid.
Please help me out
|
|
|
|
|
If this is what you want to do then you should change it inside the query to the database.
CAST(Column1 AS varchar(50))
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Also, if you only have a single table you should look at using DataTable instead of dataset. This will reduce the overhead of using datasets when you don't need the overhead of a dataset.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
I need to do the below:
Import the excel file using the available SQL server tools to a temp db. Then write a mapping between the temp db and the Main database. Move the data to the Main database.
Is this possible??
-----------------------------------------------------------------
where there is a will there is a way
|
|
|
|
|
INSERT INTO TableName(Column1, Column2, etc)
SELECT Column1, Column2, etc FROM #TempTableName
|
|
|
|
|
You should be able to use the oledb provider to link to excel and import the data into a datatable. From there you could use SQLBulk Copy to move the data easily if your column headers are the same, otherwise you will need to map the columns.
If you do not want to this in code then the other suggestion might be better.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
hi
i create a database in access but i can't insert records: permision to insert is not on
i tried :set permision dbname on but it doesn't work
please help
thank you
|
|
|
|
|
You created the db and you don't have permissions?
“Some have an idea that the reason we in this country discard things so readily is because we have so much. The facts are exactly opposite - the reason we have so much is simply because we discard things so readily. We replace the old in return for something that will serve us better.”--Alfred P. Sloan
|
|
|
|
|
Hi there.
I want to know, if i am using an Select statement in SQL, and it should return a value, but returns Null, how do i set the null value to a '0'?
Thanks
|
|
|
|
|
SELECT ISNULL(fieldname, '0')
|
|
|
|
|
Hi all,
Last weekend i had a hard disk crash. I changed the hard disk and iam using sql2000 sp3. I had a back up on another disk. But when i attempt to attach the mdf file it gives me the following msg:
Error 5172 the header for file G:\ADMIC\db.ndf is not a valid database file header. the page audit property is incorrect.
Devise activation error. The physical file G\ADMIC\db.ndf may be incorrect.
Could not open new database ADMIC. Create database is aborted.
Kindly note that the message is labelled Microsoft SQL-DMO(ODBC SQLState: 42000)
Any help is appreciated.
|
|
|
|
|
i have two month records in my table........,
example:
table look like this:
id date remarks
1 02/28/2006 test1
2 02/24/2006 test2
3 03/31/2006 test3
4 03/12/2006 test4
5 03/12/2007 test5
if i tell month on "3" and year on "2006" then it want to display...,
id=3 & 4 only...............,
how to do this one......,
plz hlp me......
Regards,
Magesh,
Magi
|
|
|
|
|
Hi
You can filter using Month() and Year() functions.
For example:
Month(DateColumn) = 3 and Year(DateColumn) = 2006
Harini
|
|
|
|
|
Can I have your email pls ?
|
|
|
|
|
DooDooo wrote: Can I have your email pls ?
No, you may not have my email.
|
|
|
|
|
Hi Everyone!
I'm trying to create a new database file from XSD schema and then populate the empty SQL database with a DataSet. The major problem is to create a table from XSD schema file. I'm using SQL Server 2005 Compact Edition and VS 2005.
File.Delete("Test.sdf");
string connString = "Data Source='Test.sdf'; LCID=1033; Password=\"s$;2'!dS64\"; Encrypt = TRUE;";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();
engine.Dispose();
SqlCeConnection conn = new SqlCeConnection(connString);
conn.Open();
DataSet dbSet = new DataSet("myDataSet");
dbSet.ReadXmlSchema("myData.xsd");
dbSet.EnforceConstraints = false;
dbSet.ReadXml("myData.xml");
...
conn.Close();
Any help would be greatly appreciated.
Gywox
-- modified at 10:34 Thursday 29th March, 2007
|
|
|
|
|
i have 2 computers. first its name is PC1 with ip 192.168.0.1 and the other PC2 192.168.0.75
PC1 has the SQL database and PC2 should access the database
i do not know how to make PC2 access the Database in PC1...
need help on that please
thanks allot
|
|
|
|
|
This answer assumes you are using SQL Server:
The connection string will refer to the name PC2, or you can use its IP address. You must also permit the SQL Server to accept network connections.
|
|
|
|
|
i really need more details...
the .mdf file on PC1 "C:\DB.mdf" ... what should the connection string used on PC2?
and how can i permit the SQL Server to accept network connections.
|
|
|
|