|
I always put the dates in in ISO format. e.g. '2004-05-19'
Also, have you checked there is actually data for that date range with WorkValue=15
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Yes, I have also tried
SELECT * FROM Document WHERE (ProcessDate>'20040519' AND ProcessDate<'20040616') ORDER BY ProcessDate
and Yes there are plenty of records that fall within the requested date range.
|
|
|
|
|
Try SET DATEFORMAT ymd first. The US English default is MDY, i.e. '04/19/2004'; yours may be different though.
|
|
|
|
|
You may need to use the CONVERT function. I.e. your SQL server is not understanding the date you submit in the query.
|
|
|
|
|
Steven Campbell wrote:
Try SET DATEFORMAT ymd first.
That won't make any difference. SQL Server always understands yyyymmdd date formatted strings, because that's the ISO standard. (Format 112 in a CONVERT statement.) Likewise, SQL Server always understands yyyy-mm-dd because that's the ISO8601/ODBC standard.
My question to Guinness is, whether that's the EXACT query you're using in query analyzer, or is it version that's been simplified for our benefit?
Grim (aka Toby) MCDBA, MCSD, MCP+SB
|
|
|
|
|
I recving error .
No Clomns were bound prior calling go SQLFetchscroll/SQLExtrendedFetch ..
wt it measn n who it should b handled ,, steps?
thanx
|
|
|
|
|
Please help me in the coding to solve this problem if you know it.
I create a frmCustomer that contains of txtCustID, txtCustFName,txtCustLName,txtCustDob and txtCustIC.... and the Add button, Search button and Exit button. When the user click on the Search button, the frmSearch will show. The user can search for the customer by select the alphabet in a combobox. The details of the customer whose last name start with that alphabet will display in the datagrid.
The datagrid in ths frmSearch contains of CustID, CustName, CustDoB. When the user double click on the specific row of the datagrid. It will retrieve the records from the Customer table in SQL server by passing the CustID and display the CustID, CustFName, CustLName, CustDob, CustIC.... to the txtCustID, txtCustFName,txtCustLName,txtCustDob and txtCustIC....on the frmCustmer. Then, the user can do the edit or delete of the record by pressing the button.
Please help.
Thanks and Best regards,
Vivian;)
|
|
|
|
|
I'm need to run a query from ACCESS 2000 that will extract data from a progress server and dump it into an ACCESS database. I have to specify the fields that I want to extract and I was already able to do so.
The problem was, there is this field TAX_due that is giving me the *hit. ACCESS gives an error message ' Scaling of Decimal Values Resulted in Data Truncation and then the query would stop.
how can I just trucate and ignore the loss data and go ahead anyway? I just aquire about 30 records then it kaboofs because of this error.
anyone, help plz.
TY!
|
|
|
|
|
Hi,
I'm making an OleDbConnection using the Sybase ASE OLE DB Provider with the following code:
_____________________________________________________________________
OleDbConnection oDbConn = new OleDbConnection(sConnectionString);
OleDbCommand oCmd = new OleDbCommand("SELECT * from master.table;", oDbConn);
OleDbDataAdapter oData = new OleDbDataAdapter(oCmd.CommandText, oConn);
DataTable oTable = new DataTable("master.table");
oData.Fill(oTable);
__________________________________________________________________
The database I'm connecting to -requires- a semi-colon at the end of the SELECT command. I've tried ending my SELECT with a semi-colon (see above) but one of my OleDb objects is removing it before it is sent to the database as I can see the following databas error when running my program:
SQL Parser: parse error at line 1.
Command: SELECT * from master.table
Issued by:
How do I control the SQL statements sent to the database via the OleDbConnection so I can add a semi-colon to my SELECTs??
TIA,
Matt
|
|
|
|
|
could you explain why you need a ';'
and also see if you can use a stored procedure to achieve the same.
Bhaskara
|
|
|
|
|
I'm sure we'll be more likely to help with your homework if you first learn how to type. Actually, on second thoughts, we probably won't. Do your own homework, and let us know when you get stuck. Once it looks like you've made some effort, I'm sure many people will be glad to help you if you get stuck.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
wgdesigner wrote:
I think u don't have any knowledge
Well, for starters, I can spell. That puts me ahead of you. And I could care less what you think. Who the hell are you ?
wgdesigner wrote:
and u don't want help anybody without ur profit...
You're right. That's why I was reading the questions forum in the first place, why I write articles here, and why I suggested that I'd be happy to help you if you were willing first to try and do your own homework. Idiot.
wgdesigner wrote:
By the way if u don't want to help then it is not matter but don't try to be oversmart bzz ur not!!!!
bzz ur not ? Man, are you this stupid, or do you think that being unable to spell makes you cool ?
wgdesigner wrote:
I want to find out the two record in database first and last record without veiwing the database tell me
Why would I tell you ? Because I 'know nothing', or because you've just been insulting me ?
wgdesigner wrote:
iam a graduate in computer science understood...
You're a graduate but you can't spell and you can't string together a simple SQL query ? I doubt it.....
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Would you like to be forcefully removed from the site? Based on the professionalism you've shown in your last post, I seriously doubt you have a degree in Computer Science. And if you do, I question the quality of the institution where it came from.
Oh! This is my one SQL statement to get me in the door here:
SELECT * FROM myTable WHERE myID LIKE 'WhoCares!'
Now, back to your question. I can't make heads or tails of what your asking. Ideas about what? All you said was you have a bank with a central server and a bunch of other banks that connect to it once a day. To do what?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
He swears just fine in English, doesn't he?
Sounds like the trailer-trash I live next to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, I got an autoreply on an abusive post he made to me, he seems since to have packed up his trailer and moved on
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
We currently use the .net SQL Server managed data provider for database access, but we are looking at possibly extending our app support to Oracle. The .net Oracle managed data provider looks like a good solution, but it brought up some questions. What support does Oracle provide for a GUID data type? What versions of Oracle support this? We notice that the Oracle data reader has the same GetGuid() SetGuid() that SQL Server provides, but are not sure how it is implemented in an actual Oracle table.
So if anyone has any info on this (or can give us a juicy link with this info) us non-Oracle guys would appreciate it!
Michael
Developer, Author, Chef
|
|
|
|
|
We are having a bit of a problem with a remote client using our software to access a JET database via ado.
I've got a few hunches on what the problem might be but I need to test this on a machine with an older MDAC and JET provider setup.
Does anyone know if Microsoft still have download sites for older service packs of the JET 4.0 files?
I Dream of Absolute Zero
|
|
|
|
|
You can't get just the JET stuff, you have to install the entire MDAC. You can do to http://download.microsoft.com[^] and search for the keyword MDAC to get the eariler versions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi there,
Have an app which uses SQLXML to provide a webservice interface to my SQLServer DB.
Have a stored procedure declared:
<br />
CREATE PROCEDURE GetSurveyCompanies<br />
<br />
@SurveyCompanyID integer = 1<br />
<br />
AS<br />
<br />
Declare @SQL NVARCHAR (4000)<br />
<br />
set @SQL = 'SELECT * FROM SurveyorCompany WHERE IDSurveyorCompany='<br />
<br />
set @sql = @sql + CAST (@SurveyCompanyID as VARCHAR(2)) + ' FOR XML AUTO'<br />
<br />
exec sp_executesql @sql<br />
<br />
And am calling it using the SOAP toolkit from VB6 using the following...
<br />
oClient.GetSurveyCompanies(1)<br />
(Have omitted the rest of the setup - sure it's OK)
When calling speciying the param, everything is OK (apart from the XML coming back garbled, but think that's a different issue!), but when I attempt to use the default param value specified in the sproc, am getting Invalid procedure call - the SOAP CLient is reporting that "incorrect number of parameters supplied" (predictably!)
Question is, how do I use the default value - have tried passing in NULL (type mismatch), Nothing (same error), and even 'NULL', but nothing seems to work - any ideas anyone?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
I have an application running on a server. I have ported this application to other server but it gives me the above error Sql Server does not exists or access denied error.I would like to know if i have to make any changes to the connection string.
Can any one help.
Thanks in advance,
Nitin.
|
|
|
|
|
You posted this in the asp.net section as well. Gave you an answer there.
|
|
|
|
|
Greeting from Malaysia
i am a beginner in VB.NET. Please how do I check the duplicate records in the database? For example, I have a table called category in SQL server. This table
contains with CategoryID and Category.
In the front end I created a form that contains only 2 textbox. One is for the category ID that the ID is auto generated and the other textbox is for the user to enter the categoris(ed. adult, kids, comedy,.......) . So, how do I check if the user enters the category that already exists in the category table in the SQL Server. Please help!
Have a nice day!
Thanks and regards,
Vivian
|
|
|
|
|
this should solve ur problem.
the value of ExecuteScalar should be checked.
Dim strCheck = "Select Count(*) from Employeemaster where Name = '" & txtEmpName.Text.Trim & "'"
Dim sqlINQry As String
Dim sqlINcmd As SqlCommand
Dim varSiteAdmin As Int32
If chkSiteAdmin.Checked = True Then
varSiteAdmin = 1
Else
varSiteAdmin = 0
End If
Try
Sqlcon = New SqlConnection(ConfigurationSettings.AppSettings("conString2"))
Sqlcon.Open()
sqlINcmd = New SqlCommand(strCheck, Sqlcon)
If sqlINcmd.ExecuteScalar() = 0 Then
sqlINQry = "Insert into EmployeeMaster " & _
"(DepartmentID,UserType,Name,Password,Moth_Maid_Name,Designation,Email, " & _
"Mobile,Phone,Fax,SiteAdmin,Status)Values (23,1," & _
"'" & txtEmpName.Text.Trim & "', " & _
"'" & txtPassword.Text.Trim & "'," & _
"'" & txtMotMaidName.Text.Trim & "'," & _
"'" & txtDesignation.Text.Trim & "'," & _
"'" & txtEmail.Text.Trim & "'," & _
"'" & txtMobile.Text.Trim & "'," & _
"'" & txtPhone.Text.Trim & "'," & _
"'" & txtFax.Text.Trim & "'," & _
"'" & varSiteAdmin & "'," & "0)"
sqlINcmd = New SqlCommand(sqlINQry, Sqlcon)
sqlINcmd.ExecuteNonQuery()
Response.Redirect("SelectEmployee.aspx")
Else
lblAddNew.Text = "Record already exists"
Exit Sub
|
|
|
|
|
Am sure this would solve the problem. But, moving all this to a stored procedure would be a good thing future enhancements. For example, if the record exists, what if we have to delete the existing record and then insert a new record. or what if we just have to update. Moving all the DB related activities would simply enhancements or modifications in future. Would suggest to use SP's wherever possible.
Bhaskara
|
|
|
|
|