jojoba2011 wrote:
This is not working and giving error !
What error? Syntax error?
jojoba2011 wrote:
I dont wanna to use
Why? What's wrong with that?
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Member 10427697 wrote:
I want to know if its possible to make it work automatically
Of course it is, think about it, you want the dates of the previous month calculated based on the current date. I'm absolutely certain PostGres has datetime functions similar to SQL Server. Alternatively you can pass in the 2 date parameters from the calling method.
Never underestimate the power of human stupidity RAH
Arun Sylvester J wrote:
If yes, would you please tell me how?
Following is what I used in google. It would suggest the specific answer is no.
mysql stored procedure access remote database
I told you, Didn't I?[^] You should start learning before asking questions like these. Save your time, our time too. Here more than couple of ways to learn anything in Internet. Education Needed[^]
thatraja
Code converters | Education Needed | Plans
Peter Leow wrote:
we will have to read and write the whole table
Excellent point.
.dan.g. AbstractSpoon Software
email: abstractspoon2(at)optusnet(dot)com(dot)au
Jörgen Andersson wrote:
Pyramid schemes are illegal in a larger part of the world, and I'm not being part of it!
Good call. The OP lists the US as where they are are from and in many jurisdictions in the US a pyramid scheme can lead to a felony conviction.
The only way to do what you want is using dynamic sql, basically build a string and execute it. A better soluton isto pass in 3 discreet variables and test each one for content.
Where ((Isnull(@UserName,'') == '' OR Table.UserName like @Username)
and ((Isnull(@Sate,'') == '' OR Table.State like @State)
Never underestimate the power of human stupidity RAH
"Debugging"; as far is I can see, it'd select the "Else If(@ID1=5)", and execute that query. Replace those queries with a "print" statement, and see if it switches to the right one.
Here's an example from BOL (2k8):
CREATE TABLE dbo.doc_exy (column_a INT ) ;
GO
INSERT INTO dbo.doc_exy (column_a) VALUES (10) ;
GO
Straightforwardly:
SELECT * FROM dbo.doc_exy
Gets:
10
Now, doing the operation appears to suggest that no default value is ever needed:
ALTER TABLE dbo.doc_exy ALTER COLUMN column_a DECIMAL (5, 2);
GO
SELECT * FROM dbo.doc_exy
Shows what I mean:
10.00
DROP TABLE dbo.doc_exy ;
GO