|
I am using SQL DMO object in vbscript to connect to SQLServer2 ,
All is working well , but I want to trap error in case if connection or login fails
ex:
Dim oSQLServer : set oSQLServer = createObject("SQLDMO.SQLServer2")
oSQLserver.Connect machine,"sa"
Develop2Program & Program2Develop
|
|
|
|
|
|
What is the output of the following query SELECT TRUNC(1234.5678,-2) FROM DUAL;
i came to knw the answer as 1200 hw?
|
|
|
|
|
If places is positive, number is truncated to places decimal places. If places is negative, number is truncated on the left of the decimal point
so in ur case
the number on the left of the decimal point is 1234
-2 = Number of decimal places used for truncating
so u have to truncate 1234 for two places
that means 1200
sdf
|
|
|
|
|
I believe the following is correct:
SELECT TRUNC(1234.5678, 2) = 1234.5600
SELECT TRUNC(1234.5678, 1) = 1234.5000
SELECT TRUNC(1234.5678, 0) = 1234.0000
SELECT TRUNC(1234.5678, -1) = 1230.0000
SELECT TRUNC(1234.5678, -2) = 1200.0000
Seeing a pattern yet?
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
|
If you are using ADO for data accessing then you
will not need to include any dll with your exe file
becaues ADO will be there on the Target Computer if it is
Win98 and more.
Still if you are sure that ADO is not on the target computer
than
you should supply msad0*.* files and then register these files on target computer by using regsvr32 utility
Thanks
|
|
|
|
|
Sorry, you have to use an official updater for Windows 2000 or Windows XP, otherwise Windows File Protection will simply undo your changes.
It reduces pain all round if you follow the official method of installing software.
|
|
|
|
|
Why you delete your question?
|
|
|
|
|
Don't delete your question - It is considered rude.
|
|
|
|
|
hi everyone ....
Ive a problem to select orders count by date only
Here ive table called ORDERSMAIN
In this ive columns Date , Order list
Here the date is along vth time wen it is entered...
SO i want to count the total number of orders entered in each day .. so the date will be distinct finally ...
n one of our frnd told me the answer in one topic ,in that the orders r counting by the Date with time...
but i need only vth date .. how to ignore the time ....
ive table like this
Sno Date Orders
1 2007/3/4 02:02:02 sfjsk
2 2007/3/4 02:02:01 sfjgf
3 2007/3/4 02:02:00 szdjfdj
4 2007/3/5 02:56:02 sfsdfs
finally i want to get is
Date ordersCount
2007/3/4 50
2007/3/3 80
2007/3/2 90
Like this plz help
Thanks inadv
Naresh
|
|
|
|
|
Hi
You can convert the datetime column to specific format ('mm/dd/yyyy'). Check different formats in SQL Help online. Use the converted column in group by clause. Here is the example for you. Here I have converted to mm/dd/yyyy that is format parameter is 103. You can change it to your requirement
select convert(nvarchar(12),DTimeStamp,103) as Dsb_Time, count(*) from Table1 <br />
where DTimeStamp is not null <br />
Group by convert(nvarchar(12),DTimeStamp,103)
Hope you got it
Harini
|
|
|
|
|
Thanqqqqqqqqqqqqqqqqqqqqqq
Harini.....
I am getting my result nowwwwwww....
Thats great
Actually iam new to sqlserver
This group is very helpfull for me ....
Thanq once again....
Naresh
|
|
|
|
|
You can try following SQL Statement:-
Select count(orders) from orderlist group by format(date,"mm-dd-yyyy") order by format(date,"mm-dd-yyyy").
The format can even be used for grouping by months.
Thanks
|
|
|
|
|
hi all,
i am a new guy..
i get good results from Recursive queries in sql server 2005 to count no of childs unde a node in a tree.
but now i am facing a problem ???
i have to define the level of a node ..
the case is as : starting from the rootnode of tree every node can have maximum of two node as left node and right node. not more than two node under a node.
so at level zero means root of node contains zero nodes.
suppose A is root of tree. first ledt node of A will be create afetr that right node a will be create. now A have two members under him so A is now at level one.
as suppose A have two node B(left)/C(right). and node B contais D/E as left right node and C(right of A ) contains F/G as Left/right node than at this level B exactly contains two nodes under him as well as C conyais two nodes . so binary has been complete. so now A is at level two.
now D has left only and G has only left node so at this level D E F G are uncomplete (having less tahn two nodes ) so now a is at two level.
so this is the pattern for that structure..
so have to et the level for every node in the tree.
now can i do
i am using asp . net 1.1/C# and sql server 2005.
This is the table structure for above :---
-------------------------------------------
Id name ParentId Left Right
--------------------------------------------
1 A -1/null 0 1
------------------------------------------
2 B 1 0 1
-------------------------------------------
3 C 1 0 1
--------------------------------------------
4 D 2 0 -1
----------------------------------------------
5 E 2 -1 -1
----------------------------------------------
6 F 3 -1 -1
-----------------------------------------------
7 G 3 0 -1
------------------------------------------------
8 H 4 -1 -1
--------------------------------------------
9 I 7 -1 -1
-----------------------------------------------
parent of A has null or -1 as reference .if a node has keft child that is represent by zero and for right one .
if a node does not contains any node this left=right will be -1;
so plz help me how can i set the level of a node in the tree.
the depth can be up to 50,000 node.
jh hsg sabdhas avdhagd advahgd axva
|
|
|
|
|
Hi in my table i have two records for the same employee in different dates...,
Now i want display the latest record of the employee how to do it??,
Example:
table like:
Id date sala1
1 3/20/2007 10000
2 3/20/2007 23000
1 5/24/2007 15000
3 6/31/2007 24000
see the above table id=1 have two records in different dates...,
now i want to show only the latest record it means:
want to display only the following record...,
Id date sala1
1 5/24/2007 15000
how to do it please help me...,
-- modified at 1:59 Thursday 24th May, 2007
Magi
|
|
|
|
|
select top 1 * from where id='1' order by Date asc
Thanks and Regards
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
Ya its working,
But order by date desc only getting correct output..,
Thanks lot for ur reply...,
Keep in touch,
Magi
|
|
|
|
|
Select MAX(Date)
From YourTable
Group by Id
maybe this can help you
|
|
|
|
|
Hi all,
How to cluster tables in sql 2005
|
|
|
|
|
Please First Refer to Books for such stuff, if you find anything difficult to understand then CODEPROJECT welcomes you.
Thanks & Regards
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
I posted my message since i did not find any relevant info from any books or else i would not ve posted
|
|
|
|
|
By clustering do you mean relationships?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Hiiii... all....
I have a table called "orders" ..
In that table ive some orderslist for particular dates ... then r not in certain order ...
now i want to count the records stored in particular date , and i want to display only the "date and total orders ( count ) done in that particular date ...
..............
like ,
Date TotalOrders(Count)
1/5/2007 50
2/5/2007 45
3/5/2007 80
LIke this ... plz help me
Thanks in adv
Naresh
|
|
|
|
|
select OrderDate, count(OrderID)
from tblOrder
where OrderDate between '2007-01-01' and '2007-03-31'
group by OrderDate
----------------------------------------------
Damian - still with no useful signature...
|
|
|
|