Hi,
There are 2 tables:
Table A (SecurityID, SecurityName)
Table B (SecurityID, Price, ClDate)
The query is to find the average price with Name=ABC Corp in year 2005
I wanted to know if this query would be right. If not, then why?
select avg(price) from B, A group by securityID having...
Hi,
I am trying to make a dropdown menu which dynamically changes when a selection is made in another menu.
So when a selection is made in the menu, another list of dropdown is shown. After the selection is made here, the user needs to click a button(go) and it should take it to the respective...
Hi,
There is a field which represents time, got from As400 table which is in numeric format(4283002). I want to convert this to time format(04:28:30) using vb scripts. Is there any cast function which will do this?
I tried what flapeyre suggested but I still keep getting errors. This is the error message I get:
TOKEN WAS NOT VALID
VALID TOKEN: DATA PTH TIME SQLID SCHEMA FUNCTION TIMESTAMP <IDENTIFIER>
Hi lkmalee
I agree with you that one of the format needs to be converted because the two operands that are compared are in different formats. But I am not sure how to convert the current date to numeric. Basically it has to changed to this format:yyyymmdd.
Any help will be appreciated.
Hi,
I have to get data from past 5 days from AS400 table.
I tried using this query:
SELECT *
FROM TESTSQL.C27AUDIT
WHERE TESTSQL.C27AUDIT.C0027_DATE >= CURRENT (DATE) - 5
But it gives me an error.
Also, I just wanted to clarify that the C0027_DATE field is a numeric field...
Hi,
I have to get data from past 5 days from AS400 table.
I tried using this query:
SELECT *
FROM TESTSQL.C27AUDIT
WHERE TESTSQL.C27AUDIT.C0027_DATE >= CURRENT (DATE) - 5
But it gives me an error.
Also, I just wanted to clarify that the C0027_DATE field is a numeric field...
Thanks Vongrunt. However, I am trying to get data from past 5 days from AS/400 database. The date format there is different. So when i tried the above mentioned way, it doesnt work.
Could anyone suggest plz?
Hi,
I have to write a query which gets data only from past 5 days from a table. This table has a column for date.
Could someone suggest how do I write the query.
Thanks!
I tried validating using IsDate function:
If Not IsDate(DTSSource("A0015_ABOLISH_DATE")) Then
processdatef = "01/01/1901"
But I am not getting the right result...All the values are displayed as 01/01/1901
How else can i validate this date?
Hi,
I am getting 'Type Mismatch: cdate error" when I am running this script...
Basically I am using DTS(Sql server) to transfer data...
And one of the columns is date...
Could someone suggest as to why I am getting an error?
Any help will be appreciated.
Thanks
The script is as follows...
Denis,
I tried the first way that you mentioned above:
declare @GUID uniqueidentifier
select @GUID =newid()
exec usp_Insert_Met_File_New @Guid
I get this error:
Server: Msg 8114, Level 16, State 4, Procedure usp_Insert_Met_File_New, Line 0
Error converting data type uniqueidentifier to char.
In this case, why am i getting an error if i pass newid() to guid while executing the stored proc?
this stored proc is going to be used by a front end application and they are going to pass newid() to guid in the application...
Denis,
What should be the format which I run the stored proc if i do NEWID() in the stored proc itself...
i tried the following:
exec usp_Insert_Met_file_New
@guid,null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null...
Hi,
I am trying to run this stored procedure, but I am getting an error saying:
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near ')'.
The stored procedure is as follows:
CREATE PROCEDURE usp_Insert_Met_File_New
@GUID uniqueidentifier,
@Class_Code char(5)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.