query

converting from string to date in VBA and clearing old SQL data output for automation program

Hi, I am building a reconciliation tool via VBA that automates queries from my oracle database and a worksheet. When I run the query I want the user to input what ITEM (in this case pipeline) to query (the worksheet has many items) and the end/start dates. I am having trouble figuring out the following: 1) It is querying - if the value ...

Is there an easy way to return the FIRST LinqToXML result?

Ok, I have a LinqToXml query that returns a single record (correct terminology?), however, I don't want to use a for.. loop to pull that one record from the query. Is there an easier way? *bonus if you find a better way to write the query (I'm still learning) my xml file: <?xml version="1.0"?> <!-- first draft of LibMappings.xml fi...

Php redirection of a form with search query term between url

Hi! I'm using PHP in order to redirect some search query. There is some example of code here (click). And my PHP code is: audio_action.php : <?php $search_field = trim($_POST['audio_field']); $search_engine = trim($_POST['audio']); $url_params = preg_replace('/(\ )+/', '+', $search_field); $url = array('deezer'=>'http://www.deezer.co...

Searching for multiple terms in a field

I want to do an AND query, say 'foo AND bar', in Lucene.NET. I have a WholeIndex field which has the whole document indexed, and I want Lucene to search in the whole document. Up to here it's quite easy, but there's a constraint. I want both terms 'foo' and 'bar' to be in the same field. Is there an easy way to do this without querying...

Pull an xml schema from a sql 2005 database

In Microsoft SQL Server 2005, there is the option to store within the database under "Database -> Type -> XML Schema Collection" a XML schema to validate against if you are viewing the database within SQL management studio. What I need to do is store the schema under the specified path above, and then within code pull that schema out t...

SQL Unique Values Numbering Sequence for Pivot

For reporting purcposes, I need to Pivot results of a query that is unique on each record. My current statement is: SELECT * FROM Sales AS x WHERE (select count(*) from Sales where customer_name=x.customer_name and order_date>=x.order_date)<=5 ORDER BY customer_name, order_date, price; A sample of the Query output is: custo...

MySQL - Disabling the query output and showing only the total execution time taken

I have a stored procedure which I want to test for speed in a production environment. So I created a new stored procedure which calls this for a 100 times, each time with different parameters. My question is: how can I disable the output that the MySQL command line prints as I am sure that this adds to the total time. So, to recap, from ...

MS Access VBA/SQL question! Pretty Simple

Hey I just sort of learned how to put my SQL statements into VBA (or atleast write them out), but I have no idea how to get the data returned? I have a couple forms (chart forms) based on queries that i run pretty regular parameters against, just altering timeframe (like top 10 sales for the month kinda of thing). Then I have procedures...

MySQL full text search across multiple tables

I have a series of tables that contain data I want to full text search. I've tried combining the tables with UNION, but the result loses its fulltext index so can't be fulltext searched. I don't think that putting the data into a temp table is the way to go. Is there someway that I can fulltext search these tables efficiently? Thanks in...

Batch update on Exchange WebDav

Hi Guys, I am trying to update a bunch of items in a shared Exchange calendar, using WebDav. What I want to do is rename events, similar to what I would do in SQL: UPDATE appointments SET subject = 'New Name' WHERE subject = 'Old Name' Is there a way to do this in a WebDav query? Thanks. ...

Sitecollection Overview Page

I have the following situation: MOSS 2007 Server Environment A -> Intranet MOSS 2007 Server Environment B -> Collaboration Environment (approx. 150 site collections for various issues) Both environments are on different infrastructures but we use the same Active Directory and the same groups. Now we would like to implement the follo...

ASP.Net not recognising querystring parameters

I'm having a problem with ASP.Net mysteriously losing one of my QueryString parameters. I have URLs like the following (pasted from my browser address bar): //Short example http://localhost/AllAboutThatWeb/SPARQL?partialResults=True&amp;query=SELECT%20*%20WHERE%20{%3Fs%20%3Fp%20%3Fo}&amp;timeout=1000 //Long example http://localhost/Al...

Query Syntax error

Please help me correct the following query: SQL = "insert into tblContract (Empid, Start1, Finish1, Store1, " & _ "Start2, Finish2, Store2 ) " & _ "values ('" & Me.txtEmpNo.Value & _ "',select max(testid) FROM tbltesting,'" & _ Me.txtContSunStart1.Value & "', '" & _ ...

How to think in SQL?

How do I stop thinking every query in terms of cursors, procedures and functions and start using SQL as it should be? Do we make the transition to thinking in SQL just by practise or is there any magic to learning the set based query language? What did you do to make the transition? ...

merging two tables with same column in meaning into one

I've got tables like this: Table Articles --------------- AID(PK) Name PublisherID Words Table Books --------------- BID(PK) Title PublisherID Date I want to merge them like: Table Total --------------- Title PublisherID In this new table, Name in Table.Articles will belong to Title column, because.. Articles.Name an...

How to tie-out with VBA, Oracle, and Excel using INDEX & MATCH functions?

Hi, I am trying to create a program using VBA that queries my oracle database data (in this case pipelines) against a spreadsheet and produces an output of the tie-out on the same workbook (but on another sheet). I would like to use the INDEX and MATCH functions on the tie-out page but have trouble figuring it out. Here is what I have so...

SQL - Most efficient way to perform this query?

Hi, I basically have three tables, posts, images and postimages (this simply contains the ids of both the other tables and allows more than one image in each post and each image to be reused in multiple posts if necessary). I'm trying to list the titles of all the posts, along with a single, small image from each (if one exists) I can ...

What would be the best way to write this query

I have a table in my database that has 1.1MM records. I have another table in my database that has about 2000 records under the field name, "NAME". What I want to do is do a search from Table 1 using the smaller table and pull the records where they match the smaller tables record. For example Table 1 has First Name, Last Name. Table 2 h...

display the active member details.

I have one database which contains username, password and IsActive (data type is "bit") columns. My requirement is that I have to display the user details when the user name and password is correct and when the active column of that user is true. How can I check these 3 columns in Sql Server 2005? ...

VBA sql query problem

Below query is resulting NO rows lstResults.RowSource = "select EmpId from tblTesting where Empid ='" & Me.txtSearchEmpId.Value & "'" Where below working fine : lstResults.RowSource = "select * from tblTesting" WHere is the fault here? I check the value of '" & Me.txtSearchEmpId.Value & "'" using break point its having the value o...