October 29, 1999

Comparing Values in a Table Against Current Time

Question: I’m having a problem writing a SELECT statement that will compares a date stored in a table against the current time. This is for a calendar on a Web site that gets its information from a database of events. The events pulled out of the database should be within

Public Folder as an Outlook Address Book

Question: I am using Exchange Server 5.5 and Outlook 97 on about 30 workstations. I use a public folder to store shared contact info. On all but two of the workstations I can right-click public folder, go to Properties and the Outlook Address Book tab, then check the box to

Nested Selects

Question: In Microsoft Access you can use a query as the source for a select in a second query. Additionally, you can use two queries as the source by utilizing an inner join. What Access does is fire off the two queries and use the result set as the data

Creating a Report for a Video Store

Question: I have a Visual Basic project about a video store, for which I have to produce a report that includes the following: Top 10 movies last month Number of new customer accounts during last month Revenue the store had last month Can you please help me with the above

Returning Results in Groups from a Database

Question: I have a Web page that lets the user query my database and return results in groups of 50 records. I know how to do the first SQL statement to get the first 50 rows but I don’t know of an easy way in SQL to return rows 51–100.

List Tables and Schemas in Access via SQL Query

Question: How do you list available tables and their schemas from an SQL query? Answer: There is an owner in the database called INFORMATION_SCHEMA who has a bunch of objects that will be of interest to you. There are INFORMATION_SCHEMA tables, columns, procs, and just a ton of stuff. If

Converting a Character String into a Time Field

Question: How do I convert a character string into a time field? Data is being read in as 12:10 and I need to calculate response times based on this field. Answer: Try this: SELECT CONVERT(CHAR(15), getdate()) or going the other way: SELECT CONVERT(DATETIME, “12/10/99”)

Setting a RowCount Limit

Question: If I just want to see some data from a table, is there some SQL syntax to prevent 2 million rows from coming back without adding conditions on the query? Limit it to, say, 100 rows. For example, something similar to this: select * from employee rowcount=100 Answer: Yes,

Explaining Stacks

Question: Could you please give me a simple explanation to what stacks are? How do they work and what are their related features? Answer: Stacks are temporary resting places for variables or code in memory. They work like those dish dispensers in large cafeterias: when you put (i.e., “push”) something

No more posts to show